标题: 关于 结果的问题 [打印本页] 作者: awkflf11 时间: 2014-3-26 11:44 标题: 关于 结果的问题 class Demo
{
public static void main(String[] args)
{
int x = 6;
show(x);
System.out.println(x)
}
public static void show(int x)
{
x = 5;
}
}
class Demo
{
int x = 6;
public static void main(String[] args)
{
Demo d = new Demo();
d.x = 8;
show(d);
System.out.println(d.x);
}
public static void show(Demo d)
{
d.x = 5;
}
}