多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

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

  • A、 The program runs and prints “Hello”
  • B、 An error causes compilation to fail.
  • C、 The program runs and prints “Hello world!”
  • D、 The program runs but aborts with an exception.
正确答案:A
答案解析:
进入题库查看解析

微信扫一扫手机做题