publicclasstest(publicintaMethod()[staticinti=0;i++;returnI;)publicstaticvoidmain(Stringargs){testtest=newtest();test.aMethod();intj=test.aMethod();System.out.printIn(j);]}Whatistheresult?() A.Compilationwillfail.B.Compilationwillsucceedandtheprogramwillprint“0”C.Compilationwillsucceedandtheprogramwillprint“1”D.Compilationwillsucceedandtheprogramwillprint“2”

publicclasstest(publicintaMethod()[staticinti=0;i++;returnI;)publicstaticvoidmain(Stringargs){testtest=newtest();test.aMethod();intj=test.aMethod();System.out.printIn(j);]}Whatistheresult?()

A.Compilationwillfail.

B.Compilationwillsucceedandtheprogramwillprint“0”

C.Compilationwillsucceedandtheprogramwillprint“1”

D.Compilationwillsucceedandtheprogramwillprint“2”


相关考题:

下列程序的执行结果是 ( ) public class Test { public int aMethod() { satic int i=0; i++; System.out.println(i); } public static void.main(String args[]) { Test test=new Test(); test.aMethod(); }A.编译错误B.0C.1D.运行成功,但不输出

publicclassTest{publicstaticvoidleftshift(inti,intj){i=j;}publicstaticvoidmain(Stringargs[]){inti=4,j=2;leftshift(i,j);System.out.printIn(i);}}Whatistheresult?() A.2B.4C.8D.16E.Thecodewillnotcompile.

publicclasstest(publicintaMethod()[staticinti=0;i++;returnI;)publicstaticvoidmain(Stringargs[]){testtest=newtest();test.aMethod();intj=test.aMethod();System.out.printIn(j);]}Whatistheresult?() A.Compilationwillfail.B.Compilationwillsucceedandtheprogramwillprint“0”C.Compilationwillsucceedandtheprogramwillprint“1”D.Compilationwillsucceedandtheprogramwillprint“2”

publicclassTest{publicintaMethod(){staticinti=0;i++;returni;}publicstaticvoidmain(Stringargs[]){Testtest=newTest();test.aMethod();intj=test.aMethod();System.out.println(j);}}Whatistheresult?() A.0B.1C.2D.Compilationfails.

publicclassTest{publicstaticvoidleftshift(inti,intj){i=j;}publicstaticvoidmain(Stringargs){inti=4,j=2;leftshift(i,j);System.out.printIn(i);}}Whatistheresult?() A.2B.4C.8D.16E.Thecodewillnotcompile.

下列代码的执行结果是public class Test{ public int aMethod(){ static int i=0; i++; System.out.println(i); } public static void main(String args[]){ Test test= new Test(); test. aMethod(); }}A.编译错误B.0C.1D.运行成功,但不输出

下列程序输出结果为( )。public class test { public static void main(String args[]) { int a=0; outer: for(int i=0;i<2;i++) { for(int j=0;j<2;j++) { if(j>i) { continue outer; } a++; } } System.out.println(a); }}A.0B.2C.3D.4

下列程序输出结果为( )。 public class test { public static void main (String args[]) { int a=0; outer:for(int i=0;i<2;i + +) { for(int j=0;j<2;j+ +) { if(j>i) { continue outer; } a+ +; } } System.out.println(a); } }A.0B.2C.3D.4

下列代码的执行结果是( )。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.0C.1D.运行成功,但不输出B.C.D.