单选题Click the Exhibit button. What is the output if the main( ) method is run?()A 4B 5C 8D 9E Compilation fails.F An exception is thrown at runtime.G It is impossible to determine for certain.

题目
单选题
Click the Exhibit button. What is the output if the main( ) method is run?()
A

4

B

5

C

8

D

9

E

Compilation fails.

F

An exception is thrown at runtime.

G

It is impossible to determine for certain.

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

第1题:

Click the Exhibit button. Given:Which statement is true if a TestException is thrown on line 3 of class B? ()

A.Line 33 must be called within a try block.

B.The exception thrown by method1 in class A is not required to be caught.

C.The method declared on line 31 must be declared to throw a RuntimeException.

D.On line 5 of class A, the call to method2 of class B does not need to be placed in a try/catch block.


参考答案:B

第2题:

Given:What is the output?()

A.42

B.420

C.462

D.42042

E.Compilation fails.

F.An exception is thrown at runtime.


参考答案:D

第3题:

Click the Exhibit button. What is the result? ()

A.Value is: 8

B.Compilation fails.

C.Value is: 12

D.Value is: -12

E.The code runs with no output.

F.An exception is thrown at runtime.


参考答案:A

第4题:

public class Foo {  public static void main(String[] args) {  try {  return;  } finally {  System.out.println( “Finally” );  }  }  }  What is the result?()

  • A、 Finally
  • B、 Compilation fails.
  • C、 The code runs with no output.
  • D、 An exception is thrown at runtime.

正确答案:A

第5题:

public class TestString 1 {  public static void main(String[] args) {  String str = “420”;  str += 42;  System.out.print(str);  }  }  What is the output?()

  • A、 42
  • B、 420
  • C、 462
  • D、 42042
  • E、 Compilation fails.
  • F、 An exception is thrown at runtime.

正确答案:D

第6题:

Click the Exhibit button.Given:What is the result?()

A.Line 26 prints "a" to System.out.

B.Line 26 prints "b" to System.out.

C.An exception is thrown at line 26 at runtime.

D.Compilation of class A will fail due to an error in line 6.


参考答案:A

第7题:

Click the Exhibit button. What is the output if the main() method is run?()

A.4

B.5

C.8

D.9

E.Compilation fails.

F.An exception is thrown at runtime.

G.It is impossible to determine for certain.


参考答案:D

第8题:

Click the Exhibit button. Given: ClassA a = new ClassA(); a.methodA(); What is the result? ()

A.Compilation fails.

B.ClassC is displayed.

C.The code runs with no output.

D.An exception is thrown at runtime.


参考答案:D

第9题:

public static void main(String[] args) {  for (int i=0;i<= 10;i++){  if( i>6) break;  }  System.out.println(i);  }  What is the result?() 

  • A、 6
  • B、 7
  • C、 10
  • D、 11
  • E、 Compilation fails.
  • F、 An exception is thrown at runtime.

正确答案:E

第10题:

public class Starter extends Thread {  private int x= 2;  public static void main(String[] args) throws Exception {  new Starter().makeItSo();  }  public Starter() {  x=5;  start();  }  public void makeItSo() throws Exception {  join();  x=x- 1;  System.out.println(x);  }  public void run() { x *= 2; }  }  What is the output if the main() method is rum?() 

  • A、 4
  • B、 5
  • C、 8
  • D、 9
  • E、 Compilation fails.
  • F、 An exception is thrown at runtime.
  • G、 It is impossible to determine for certain.

正确答案:D

更多相关问题