问题:
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.
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?()
● 参考解析
本题暂无解析
相关内容
相关标签