问题:
class TestReference{
public static void main(String[] args){
int x=2;
TestReference tr = new TestReference();
System.out.print(x);
tr.change(x);
System.out.print(x); }
public void change(int num){
num = num + 1; } }
程序运行后的输出是哪项()?
A . 23
B . 21
C . 22
D . 编译错误
class TestReference{
public static void main(String[] args){
int x=2;
TestReference tr = new TestReference();
System.out.print(x);
tr.change(x);
System.out.print(x); }
public void change(int num){
num = num + 1; } }
程序运行后的输出是哪项()?
● 参考解析
本题暂无解析
相关内容
相关标签