本帖最后由 小穿钉 于 2015-10-24 22:44 编辑
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);
}
}
|
|