当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

下列代码的执行结果是()。 public class Test{ public int aMethod( ){ static int i=0; i++;


下列代码的执行结果是()。

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.

请帮忙给出正确答案和分析,谢谢!

参考答案
您可能感兴趣的试题
  • 下列代码的执行结果是()public class Test2{public static void main(String args[]){int a=4 b=

  • 分析下面指令序列执行后的正确结果是( )。 MOV BX OFFFCH MOV CL 2 SAR BX CLA.3FFFHB

  • 下列代码的执行结果是 public class Test{ public int aMethod( ) { static int i=0;

  • 已知 import java.io.*; class Person{ public static void print();} } 对于以上代码 其输出结果是

  • 下面代码的运行结果是public class Test{public static void main(String args[]){for(int i=0;i

  • 下列代码执行之后 输出的结果为______。 public class ex34{ public static void main(String[]ar