A-A+

下列代码的执行结果是()。public class Test{public int aMet

2022-08-05 20:46:15 问答库 阅读 172 次

问题详情

下列代码的执行结果是()。
public class Test{
public int aMethod(){
static int i=0;
i++;
System.out.println(i):
}
public static void main (String args[]){
Trest test=new Test ();
test aMethod():
}
}
A.编译错误
B.0
C.1
D.运行成功,但不输出
B.
C.
D.请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:A

考点:代码