各位能不能给我讲讲这道题为什么选A呢??为什么不选C呢?急
1. public class X {
2. public static void main (String[]args) {
2. string s = new string (“Hello”);
3. modify(s);
4. System.out.printIn(s);
5. }
7.
8. public static void modify (String s) {
9. s += “world!”;
10. }
11. }
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.