1Z0-853

单选题Given the command line java Pass2 and: What is the result? ()AdoStuff x = 6 main x = 6BCompilation fails.CdoStuff x = 6 main x = 7DAn exception is thrown at runtime.EdoStuff x = 7 main x = 6FdoStuff x = 7 main x = 7

题目
单选题
Given the command line java Pass2 and: What is the result? ()
A

 doStuff x = 6 main x = 6

B

 Compilation fails.

C

 doStuff x = 6 main x = 7

D

 An exception is thrown at runtime.

E

 doStuff x = 7 main x = 6

F

 doStuff x = 7 main x = 7

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

public class Yippee2 {  static public void main(String [] yahoo) {  for(int x= 1; xSystem.out.print(yahoo[x] + “ “);  }  }  }  and the command line invocation: java Yippee2 a b c What is the result?() 

  • A、a b
  • B、b c
  • C、a b c
  • D、 Compilation fails.
  • E、 An exception is thrown at runtime.

正确答案:B

第2题:

public class WhileFoo {  public static void main (String []args)   {  int x= 1, y = 6;  while (y--)  {x--;}  system.out.printIn(“x=” + x “y =” + y);  }  }   What is the result?()  

  • A、 The output is x = 6 y = 0
  • B、 The output is x = 7 y = 0
  • C、 The output is x = 6 y = -1
  • D、 The output is x = 7 y = -1
  • E、 Compilation will fail.

正确答案:E

第3题:

public class Pass{public static void main(String[]args){int x=5;Pass p=new Pass();p.doStuff(x);System.out.print("mainx="+x);}void doStuff(intx){System.out.print("doStuffx="+x++);}}What is the result?()

A.Compilation fails.

B.An exception is thrown at runtime.

C.doStuff x=6 main x=6

D.doStuff x=5 main x=5

E.doStuff x=5 main x=6

F.doStuff x=6 main x=5


参考答案:D

第4题:

public class Pass {  public static void main(String [1 args) {  int x 5;  Pass p = new Pass();  p.doStuff(x);  System.out.print(” main x = “+ x);  }  void doStuff(int x) {  System.out.print(” doStuff x = “+ x++);  }  }  What is the result?() 

  • A、 Compilation fails.
  • B、 An exception is thrown at runtime.
  • C、 doStuffx = 6 main x = 6
  • D、 doStuffx = 5 main x = 5
  • E、 doStuffx = 5 main x = 6
  • F、 doStuffx = 6 main x = 5

正确答案:D

第5题:

Given the command line java Pass2 and: public class Pass2{ public void main(String[]args){ int x=6; Pass2 p=new Pass2(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()

  • A、Compilation fails.
  • B、An exception is thrown at runtime.
  • C、doStuffx=6 main x=6
  • D、doStuffx=6 mainx =7
  • E、doStuffx=7 mainx =6
  • F、doStuffx=7 mainx =7

正确答案:B

第6题:

public class Pass{ public static void main(String[]args){ int x=5; Pass p=new Pass(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()

  • A、Compilation fails.
  • B、An exception is thrown at runtime.
  • C、doStuff x=6 main x=6
  • D、doStuff x=5 main x=5
  • E、doStuff x=5 main x=6
  • F、doStuff x=6 main x=5

正确答案:D

第7题:

interface DeclareStuff{  public static final int EASY = 3;  void doStuff(int t); }  public class TestDeclare implements DeclareStuff {  public static void main(String [] args) {  int x=5;  new TestDeclare().doStuff(++x);  }  void doStuff(int s) {  s += EASY + ++s;  System.out.println(”s “ + s);  }  }  What is the result?() 

  • A、 s 14
  • B、 s 16
  • C、 s 10
  • D、 Compilation fails.
  • E、 An exception is thrown at runtime.

正确答案:D

第8题:

Given the command line java Pass2 and:public class Pass2{public void main(String[]args){int x=6;Pass2 p=new Pass2();p.doStuff(x);System.out.print("mainx="+x);}void doStuff(intx){System.out.print("doStuffx="+x++);}}What is the result?()

A.Compilation fails.

B.An exception is thrown at runtime.

C.doStuffx=6 main x=6

D.doStuffx=6 mainx =7

E.doStuffx=7 mainx =6

F.doStuffx=7 mainx =7


参考答案:B

第9题:

Given the command line java Pass2 and:  public class Pass2 {  public void main(String [] args) {  int x=6;  Pass2 p = new Pass2();  p.doStuff(x);  System.out.print(” main x = “+ x); }  void doStuff(int x) {  System.out.print(” doStuffx = “+ x++);  }  }  What is the result?() 

  • A、 Compilation fails.
  • B、 An exception is thrown at runtime.
  • C、 doStuffx = 6 main x = 6
  • D、 doStuffx = 6 main x = 7
  • E、 doStuffx = 7 main x = 6
  • F、 doStuffx = 7 main x = 7

正确答案:B

第10题:

public class Yippee {  public static void main(String [] args) {  for(int x = 1; x < args.length; x++) {  System.out.print(args[x] +“ “);  }  }  }  and two separate command line invocations:  java Yippee  java Yippee 1234  What is the result?() 

  • A、 No output is produced. 123
  • B、 No output is produced. 234
  • C、 No output is produced. 1234
  • D、 An exception is thrown at runtime. 123
  • E、 An exception is thrown at runtime. 234
  • F、 An exception is thrown at rijntime. 1234

正确答案:B

更多相关问题