单项选择题
1. abstract class AbstractIt {
2. abstract float getFloat();
3. }
4. public class AbstractTest extends AbstractIt {
5. private float f1 = 1.0f;
6. private float getFloat() { return f1; }
7. }
What is the result?()
A. Compilation succeeds.
B. An exception is thrown.
C. Compilation fails because of an error at line 2.
D. Compilation fails because of an error at line 6.
点击查看答案&解析
相关考题
-
单项选择题
public class Test {} What is the prototype of the default constructor?()
A. Test()
B. Test(void)
C. public Test()
D. public Test(void)
E. public void Test() -
单项选择题
try { int x = 0; int y = 5 / x; } catch (Exception e) { System.out.println(“Exception”); } catch (ArithmeticException ae) { System.out.println(“Arithmetic Exception”); } System.out.println(“finished”); What is the result?()
A. finished
B. Exception
C. Compilation fails.
D. Arithmetic Exception -
单项选择题
int i = 0; while (true) { if(i==4) { break; } ++i; } System.out.println(“i=”+i); What is the result?()
A. i = 0
B. i = 3
C. i = 4
D. i = 5
E. Compilation fails.
