JAVA试题,跪求答案
JAVA试题,跪求答案阅读下列程序,请写出该程序的输出结果。publicclassA{intm=5;staticintn=3;publicstaticvoidmain(S...
JAVA试题,跪求答案阅读下列程序,请写出该程序的输出结果。
public class A {
int m = 5;
static int n = 3;
public static void main(String[] args) {
A obj 1 = new A();
A obj2 = new A();
objl.m *= 2;
objl.n *= 2;
obj2.m += 1;
obj2.n += 4;
System.out.println("obj 1.m='' + obj 1.m);
System.out.println("obj 1.n=" + obj 1.n);
System.out.println("obj2.m=" + obj2.m);
System.out.println("obj2.n=" + obj2.n);
}
} 展开
public class A {
int m = 5;
static int n = 3;
public static void main(String[] args) {
A obj 1 = new A();
A obj2 = new A();
objl.m *= 2;
objl.n *= 2;
obj2.m += 1;
obj2.n += 4;
System.out.println("obj 1.m='' + obj 1.m);
System.out.println("obj 1.n=" + obj 1.n);
System.out.println("obj2.m=" + obj2.m);
System.out.println("obj2.n=" + obj2.n);
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询