选择题
7.
有如下代码:
public class Test
{
public static void changeStr(String str) { str="world"; }
public static void main(String[]args)
{
String str="hello";
changeStr(str);
System.out.println(str);
}
}
程序的输出是______。
A、
hello
B、
world
C、
hello world
D、
world hello
【正确答案】
A
【答案解析】
本题中,方法调用的执行过程如图所示。
提交答案
关闭