可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

public class X { 


public class X {   public static void main (Stringargs) {   string s = new string (“Hello”);   modify(s);   System.out.printIn(s);   }   public static void modify (String s) {   s += “world!”;   }   }   What is the result?() 

  • AThe program runs and prints “Hello”
  • BAn error causes compilation to fail.
  • CThe program runs and prints “Hello world!”
  • DThe program runs but aborts with an exception.
参考答案
参考解析:
分类:SCJP程序员认证考试题库