网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

public class Test {  public static void leftshift(int i, int j) {  i<<=j;  }  public static void main(String args[])  {  int i = 4, j = 2;  leftshift(i, j);   System.out.printIn(i); }  }     What is the result?()  

  • A、 2
  • B、 4
  • C、 8
  • D、 16
  • E、 The code will not compile.

参考答案

更多 “ public class Test {  public static void leftshift(int i, int j) {  i=j;  }  public static void main(String args[])  {  int i = 4, j = 2;  leftshift(i, j);   System.out.printIn(i); }  }     What is the result?()  A、 2B、 4C、 8D、 16E、 The code will not compile.” 相关考题
考题 执行下列程序段之后,输出的结果为______。public class exl0{public static void main(String[] args){int i=3;int j=7;int k=8;boolean b=j>i∧k!=i;System.out.println(b);}}

考题 请阅读下面程序public class Test {public static void main (String[] args) {int i,j;for (i=1;i<5;i++) {for (j=1;j<=i;j++)system.out.print (i+"X"+j+"="+i*j+" ");System.out.println();}}}程序执行完后,i循环和j循环执行的次数分别是【 】。

考题 下列程序执行后,j的值是 public class Testggg { public static void main(String args[ ]) { int j=1; for(int i=7;i0;i-=2) j * =2; System.out.println(j); } }A.15B.1C.32D.16

考题 下列程序执行之后,输出的结果是______。 public class ex4 { public static void main(String[] args) { int j=0; for(int i=3;i>0;i--) { j+=i; int x=2; while(x<j) { x+=1; System.out,print(x); } } } }A.3555B.35556666C.33453456D.345

考题 下面语句执行后,i的值是______。 public class Test11 { public static void main(String[] args) { int i=0; for( int j=10; j>5i<5; j-=3,i+=2 ) { i=i+j; } System.out.println (i); } }A.10B.9C.8D.12

考题 下面程序段的输出结果是( )。 public class Test { public static void main (String[] args) { int j=2,i=5; while (j<i--) j++; System.out.println(j);} }A.2B.3C.4D.5

考题 下列程序执行后,j的值是( )。 public class Testggg{ public static void main(String args[]) { int j=1; for(int i=7;i>0;i-=2) j*=2; System.out.println(j); } }A.15B.1C.32D.16

考题 下列程序执行后的结果是______。public class ex24{public static void main(String[] args){int j=10;a1: for(int i=3;i>0;i--){j-=i;int m=l;a2: while (m<j){if (i<=m)continue a1;j/=m++;}}System.out.println(j);}}下列嵌套的循环程序执行后,结果是______。 public class ax25 { public static void main(String[] args) { int sum=0; for(int i=0;i<=5;i++) { for(int j=10;j>3*i;j--) { sum+=j*i; } } System.out.println(sum); } }A.136B.127C.147D.153

考题 下列程序输出结果为( )。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

考题 控制台应用程序 example.java 如下:public class example{public static void main(String[] args){int i=0, j=9;do{if(i++--j) break;} while(i4);System.out.println("i="+i+" and j="+j);}}

考题 下列程序执行后,j的值是( )。 public class Test { public static void main(String args[]) { int j=1; for(int i=7;i>0;i-=2) j*=2; System.out.println(j); } }A.15B.1C.32D.16

考题 下列程序输出结果为( )。 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 Sun { public static void main(String args[]) { int[] a={1,2,3,4); int j=1,s=0; for(int i=3;i>=0;i--) { s=s+a[i]*j; j=j*10; } System.out.println(s); } }A.1234B.21C.43D.4321

考题 执行下面程序后,结果是 public class Testrr { public static void main(String args[]){ int i=0xFFFFFFF1; int j=-i; System.out.println("j="+j); } }A.j=-15B.j=-16C.j=16D.j=15

考题 下列语句执行后,i的值是( )。 public class Test { public static void main(String[ ] args) { int i =0; for(int j=10; j>5i<5; j-=3,i+=2) i=i+j; System.out.println(i); } }A.8B.9C.10D.12

考题 以下程序的运行结果为:public class test {public static void main(String args[]) {int i=0, j=2;do {i=++i;j--;} while(j>0);System.out.println(i);}} A. 0B. 1C. 2D.3

考题 public class Test {  public static void main(String Args[]) {  int i =1, j = 0;  switch(i) {  case 2: j +=6;  case 4: j +=1;  default: j +=2;  case 0: j +=4;  }  System.out.println(“j =” +j);  }  }  What is the result? () A、 0B、 2C、 4D、 6E、 9F、 13

考题  public class Foo {   public static void main (String []args) {   int i = 1;   int j = i++;   if ((i++j)  (i++ ==j))  {           i +=j;          }        }      }   What is the final value of i?()  A、 1B、 2C、 3D、 4E、 5

考题 public class ForBar {   public static void main(String args) {   int i = 0, j = 5;   tp: for (;;) {   i ++;   for(;;)   if(i  --j) break tp;   }   system.out.printIn(“i = ” + i + “, j = “+ j);   }   }   What is the result? () A、 The program runs and prints “i=1, j=0”B、 The program runs and prints “i=1, j=4”C、 The program runs and prints “i=3, j=4”D、 The program runs and prints “i=3, j=0”E、 An error at line 4 causes compilation to fail.F、 An error at line 7 causes compilation to fail.

考题 public class test(    public int aMethod()[   static int i=0;   i++;   return I;   )    public static void main (String args){   test test = new test();    test.aMethod();   int j = test.aMethod();   System.out.printIn(j);   ]  }   What is the result?()A、 Compilation will fail.B、 Compilation will succeed and the program will print “0”C、 Compilation will succeed and the program will print “1”D、 Compilation will succeed and the program will print “2”

考题 public class Test {  public int aMethod() {  static int i = 0;  i++;  return i;  }  public static void main (String args[]) {  Test test = new Test();  test.aMethod();  int j = test.aMethod();  System.out.println(j);  }  }  What is the result?()  A、 0B、 1C、 2D、 Compilation fails.

考题 public class test (      private static int j = 0;  private static boolean methodB(int k) (  j += k;  return true;  )  public static void methodA(int  i)(  boolean b:     b = i  10 | methodB (4);  b = i  10 || methodB (8);  )  public static void main (String args[])(   methodA (0);  system.out.printIn(j);  )  )   What is the result?()  A、 The program prints “0”B、 The program prints “4”C、 The program prints “8”D、 The program prints “12”E、 The code does not complete.

考题 单选题public class Test {  public static void main(String Args[]) {  int i =1, j = 0;  switch(i) {  case 2: j +=6;  case 4: j +=1;  default: j +=2;  case 0: j +=4;  }  System.out.println(“j =” +j);  }  }  What is the result? ()A  0B  2C  4D  6E  9F  13

考题 单选题public class Test {  public int aMethod() {  static int i = 0;  i++;  return i;  }  public static void main (String args[]) {  Test test = new Test();  test.aMethod();  int j = test.aMethod();  System.out.println(j);  }  }  What is the result?()A  0B  1C  2D  Compilation fails.

考题 单选题public class Foo {   public static void main (String []args) {   int i = 1;   int j = i++;   if ((i++j)  (i++ ==j))  {           i +=j;          }        }      }   What is the final value of i?()A  1B  2C  3D  4E  5

考题 单选题public class Test {  public static void leftshift(int i, int j) {  i=j;  }  public static void main(String args[])  {  int i = 4, j = 2;  leftshift(i, j);   System.out.printIn(i); }  }     What is the result?()A  2B  4C  8D  16E  The code will not compile.

考题 单选题public class test (      private static int j = 0;  private static boolean methodB(int k) (  j += k;  return true;  )  public static void methodA(int  i)(  boolean b:     b = i  10 | methodB (4);  b = i  10 || methodB (8);  )  public static void main (String args[])(   methodA (0);  system.out.printIn(j);  )  )   What is the result?()A  The program prints “0”B  The program prints “4”C  The program prints “8”D  The program prints “12”E  The code does not complete.