下列程序的运行结果是()public class Test {public static void main(String[] args) {String str = NULL;System.out.println(str);}}
A:
A:
举一反三
- public class ChangeStrDemo { public static void changeStr(String str){ str="welcome"; } public static void main(String[] args) { String str="home"; changeStr(str); System.out.println(str); } }给出程序的运行结果( )
- public class Test { public static void main(String[] args) { String s1 = "abc"; String s2 = new String ("abc"); System.out.println(s1 == s2); } } 程序运行结果是
- 下面程序段的输出结果是 public class A{ public static void main(String args[]) { String str ="Hello,"; str=str+"Guys!"; System.out.println(str); } }
- 有如下代码: public class Test{ public static void main(String args[]) { String str = new String("World"); char ch[] = {'H','e','l','l','o'}; change(str,ch); System.out.println(str + "and" + ch); } public static void change(String str, char ch[]) { str = "Changed"; ch[0] = 'C'; } } 运行后输出的结果是:
- public class Example{ public static void main(String[] args) { String[] strs = { "Tom", "Jerry", "Donald" }; // foreach循环遍历数组 for (String str : strs) { str = "Tuffy"; } System.out.println(strs[0] + "," + strs[1] + "," + strs[2]); } } 下列选项中,程序的运行结果是