public class SomeException {  } Class a:  public class a { 

题目
单选题
public class SomeException {  } Class a:  public class a {  public void doSomething() { }  } Class b:  public class b extends a {  public void doSomething() throws SomeException { }  }  Which is true about the two classes?()
A

 Compilation of both classes will fail.

B

 Compilation of both classes will succeed.

C

 Compilation of class a will fail. Compilation of class b will succeed.

D

 Compilation of class a will fail. Compilation of class a will succeed.

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

第1题:

单选题
What does the value returned by the method getID() found in class java.awt.AWTEvent uniquely identify?()
A

The particular event instance.

B

The source of the event.

C

The set of events that were triggered by the same action.

D

The type of event.

E

The type of component from which the event originated.


正确答案: D
解析: 暂无解析

第2题:

多选题
Which declarations will allow a class to be started as a standalone program?()
A

public void main(String args[])

B

public void static main(String args[])

C

public static main(String[] argv)

D

final public static void main(String [] array)

E

public static void main(String args[])


正确答案: C,E
解析: 暂无解析

第3题:

单选题
You want subclasses in any package to have access to members of a superclass. Which is the mostrestrictive access modifier that will accomplish this objective?()
A

 Public

B

 Private

C

 Protected

D

 Transient

E

 No access modifier is qualified


正确答案: A
解析: 暂无解析

第4题:

单选题
public class test (    public static void main (String args) {    int i = 0xFFFFFFF1;  int j = ~i;   }    )   What is the decimal value of j at line 5?()
A

 0

B

 1

C

 14

D

 –15

E

 An error at line 3 causes compilation to fail.

F

 An error at line 4 causes compilation to fail.


正确答案: C
解析: 暂无解析

第5题:

单选题
public class ArrayTest {   public static void main (Stringargs) {   float f1, f2;   f1 = new float [10];  f2 = f1;   System.out.printIn (“f2[0]=” + f2[0]);   }  }   What is the result?()
A

 It prints f2[0] = 0.0

B

 It prints f2[0] = NaN

C

 An error at line 5 causes compile to fail.

D

 An error at line 6 causes compile to fail.

E

 An error at line 6 causes an exception at runtime.


正确答案: B
解析: 暂无解析

第6题:

单选题
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”


正确答案: D
解析: 暂无解析

第7题:

单选题
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


正确答案: E
解析: 暂无解析

第8题:

单选题
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
解析: 暂无解析

第9题:

单选题
1. class A {  2. public byte getNumber ()  {  3.   return 1;  4.   }  5. }  6.    7. class B extends A {  8. public short getNumber()  {  9.  return 2;  10. }  11.    12. public static void main (String args[]) {   13.    B  b = new B ();  14.      System.out.printIn(b.getNumber())     15.   }  16. }    What is the result?()
A

 Compilation succeeds and 1 is printed.

B

 Compilation succeeds and 2 is printed.

C

 An error at line 8 causes compilation to fail.

D

 An error at line 14 causes compilation to fail.

E

 Compilation succeeds but an exception is thrown at line 14.


正确答案: D
解析: 暂无解析

第10题:

多选题
Which three are valid declarations of a float? ()
A

Float foo = -1;

B

Float foo = 1.0;

C

Float foo = 42e1;

D

Float foo = 2.02f;

E

Float foo = 3.03d;

F

Float foo = 0x0123;


正确答案: F,D
解析: 暂无解析

更多相关问题