class Test{
public int x=1;
public static int y=1;
}
public class Test1{
public static void main(String[] args){
Test.y=Test.y+1;
Test m=new Test();
Test n=new Test();
m.x=m.x+3;
m.y=m.y+3;
n.x=n.x+5;
n.y=n.y+5;
System.out.println("m.x="+m.x+""+"m.y="+m.y);
System.out.println("n.x="+n.x+""+"n.y="+n.y);
}
} 作者: 小穿钉 时间: 2015-10-24 21:57
答案是:m.x=4 m.y=5
n.x=9 n.y=7