单选题Given: Which is true?()AIf line 10 is removed, the compilation succeeds.BIf line 11 is removed, the compilation succeeds.CIf line 12 is removed, the compilation succeeds.DIf line 13 is removed, the compilation succeeds.EMore than one line must be remo

题目
单选题
Given: Which is true?()
A

If line 10 is removed, the compilation succeeds.

B

If line 11 is removed, the compilation succeeds.

C

If line 12 is removed, the compilation succeeds.

D

If line 13 is removed, the compilation succeeds.

E

More than one line must be removed for compilation to succeed.


相似考题
更多“单选题Given: Which is true?()A If line 10 is removed, the compilation succeeds.B If line 11 is removed, the compilation succeeds.C If line 12 is removed, the compilation succeeds.D If line 13 is removed, the compilation succeeds.E More than one line mu”相关问题
  • 第1题:

    1. interface foo {  2. int k = 0;  3. } 4.    5. public class test implements Foo (  6. public static void main(String args[]) (  7. int i;  8. Test test = new test ();  9. i= test.k;  10.i= Test.k;  11.i= Foo.k;  12.)  13.)  14.        What is the result?()  

    • A、 Compilation succeeds.
    • B、 An error at line 2 causes compilation to fail.
    • C、 An error at line 9 causes compilation to fail.
    • D、 An error at line 10 causes compilation to fail.
    • E、 An error at line 11 causes compilation to fail.

    正确答案:A

  • 第2题:

    interface foo {   int k = 0;   }    public class test implements Foo (   public static void main(String args) (    int i;   Test test = new test ();   i= test.k;   i= Test.k;   i= Foo.k;   )   )   What is the result? ()

    • A、 Compilation succeeds.
    • B、 An error at line 2 causes compilation to fail.
    • C、 An error at line 9 causes compilation to fail.
    • D、 An error at line 10 causes compilation to fail.
    • E、 An error at line 11 causes compilation to fail.

    正确答案:A

  • 第3题:

    单选题
    Click the Exhibit button. Which statement is true about the classes and interfaces in the exhibit?()
    A

    Compilation will succeed for all classes and interfaces.

    B

    Compilation of class C will fail because of an error in line 2.

    C

    Compilation of class C will fail because of an error in line 6.

    D

    Compilation of class AImpl will fail because of an error in line 2.


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

  • 第4题:

    单选题
    Given: What is the result?()
    A

    test

    B

    null

    C

    An exception is thrown at runtime.

    D

    Compilation fails because of an error in line 1.

    E

    Compilation fails because of an error in line 4.

    F

    Compilation fails because of an error in line 5.


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

  • 第5题:

    单选题
    Given: What is the result?()
    A

    Canada

    B

    null Canada

    C

    Canada null

    D

    Canada Canada

    E

    Compilation fails due to an error on line 26.

    F

    Compilation fails due to an error on line 29.


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

  • 第6题:

    单选题
    package foo;  import java.util.Vector; private class MyVector extends Vector {  int i = 1;  public MyVector() {  i = 2; } }  public class MyNewVector extends MyVector {  public MyNewVector() {  i = 4;  }  public static void main(String args[]) {  MyVector v = new MyNewVector();  }  }  What is the result?()
    A

     Compilation succeeds.

    B

     Compilation fails because of an error at line 5.

    C

     Compilation fails because of an error at line 6.

    D

     Compilation fails because of an error at line 14.

    E

     Compilation fails because of an error at line 17.


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

  • 第7题:

    单选题
    Given: What is the result?()
    A

    X, followed by an Exception.

    B

    No output, and an Exception is thrown.

    C

    Compilation fails due to an error on line 14.

    D

    Compilation fails due to an error on line 16.

    E

    Compilation fails due to an error on line 17.


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

  • 第8题:

    单选题
    What is the result?()
    A

    Compilation succeeds.

    B

    Compilation fails due to multiple errors.

    C

    Compilation fails due to an error only on line 20.

    D

    Compilation fails due to an error only on line 21.

    E

    Compilation fails due to an error only on line 22.

    F

    Compilation fails due to an error only on line 12.


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

  • 第9题:

    单选题
    Given: Which is true?()
    A

    If line 10 is removed, the compilation succeeds.

    B

    If line 11 is removed, the compilation succeeds.

    C

    If line 12 is removed, the compilation succeeds.

    D

    If line 13 is removed, the compilation succeeds.

    E

    More than one line must be removed for compilation to succeed.


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

  • 第10题:

    单选题
    Given: What is the result?()
    A

    The code runs with no output.

    B

    An exception is thrown at runtime.

    C

    Compilation fails because of an error in line 20.

    D

    Compilation fails because of an error in line 21.

    E

    Compilation fails because of an error in line 23.

    F

    Compilation fails because of an error in line 25.


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

  • 第11题:

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


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

  • 第12题:

    单选题
    1. package foo; 2.  3. import java.util.Vector; 4.  5. protected class MyVector Vector { 6. init i = 1; 7. public MyVector() { 8. i = 2; 9. } 10. } 11.  12. public class MyNewVector extends MyVector { 13. public MyNewVector() { 14. i = 4; 15. } 16. public static void main(String args[]) { 17. MyVector v = new MyNewVector(); 18. } 19. } What is the result?()
    A

     Compilation succeeds.

    B

     Compilation fails because of an error at line 5.

    C

     Compilation fails because of an error at line 6.

    D

     Compilation fails because of an error at line 14.

    E

     Compilation fails because of an error at line 17.


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

  • 第13题:

    public class X {  public static void main (String[] args)  {  byte b = 127;  byte c = 126;  byte d = b + c;  }  }   Which statement is true?()  

    • A、 Compilation succeeds and d takes the value 253.
    • B、 Line 5 contains an error that prevents compilation.
    • C、 Line 5 throws an exception indicating “Out of range”
    • D、 Line 3 and 4 contain error that prevent compilation.
    • E、 The compilation succeeds and d takes the value of 1.

    正确答案:B

  • 第14题:

    单选题
    interface foo {   int k = 0;   }    public class test implements Foo (   public static void main(String args) (    int i;   Test test = new test ();   i= test.k;   i= Test.k;   i= Foo.k;   )   )   What is the result? ()
    A

     Compilation succeeds.

    B

     An error at line 2 causes compilation to fail.

    C

     An error at line 9 causes compilation to fail.

    D

     An error at line 10 causes compilation to fail.

    E

     An error at line 11 causes compilation to fail.


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

  • 第15题:

    单选题
    Given: What is the result?()
    A

    Compilation succeeds.

    B

    Compilation fails due to multiple errors.

    C

    Compilation fails due to an error only on line 20.

    D

    Compilation fails due to an error only on line 21.

    E

    Compilation fails due to an error only on line 22.


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

  • 第16题:

    单选题
    Given: What is the result?()
    A

    Compilation fails due to an error in line 23.

    B

    Compilation fails due to an error in line 29.

    C

    A ClassCastException occurs in line 29.

    D

    A ClassCastException occurs in line 31.

    E

    The value of all four objects prints in natural order.


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

  • 第17题:

    单选题
    public class X {   public static void main (String args) {   byte b = 127;   byte c = 126;   byte d = b + c;   }   }   Which statement is true?()
    A

     Compilation succeeds and d takes the value 253.

    B

     Line 5 contains an error that prevents compilation.

    C

     Line 5 throws an exception indicating “Out of range”

    D

     Line 3 and 4 contain error that prevent compilation.

    E

     The compilation succeeds and d takes the value of 1.


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

  • 第18题:

    单选题
    Given:   11. public static void main(String[] args) {   12. Object obj = new int[] { 1, 2, 3 };   13. int[] someArray = (int[])obj;   14. for (int i : someArray) System.out.print(i + " ");   15. }   What is the result? ()
    A

     Compilation fails because of an error in line 13.

    B

     A ClassCastException is thrown at runtime.

    C

     1 2 3

    D

     Compilation fails because of an error in line 14.

    E

     Compilation fails because of an error in line 12.


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

  • 第19题:

    单选题
    Given: What is the result?()
    A

    An Exception is thrown with no other output

    B

    followed by an Exception

    C

    Compilation fails due to an error on line 9

    D

    Compilation fails due to an error on line 14


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

  • 第20题:

    单选题
    Given: Which statement is true?()
    A

    Compilation succeeds.

    B

    Class A does not compile.

    C

    The method declared on line 9 cannot be modified to throw TestException.

    D

    TestA compiles if line 10 is enclosed in a try/catch block that catches TestException.


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

  • 第21题:

    单选题
    Given: What is the result when method testIfA is invoked?()
    A

    True

    B

    Not true

    C

    An exception is thrown at runtime.

    D

    Compilation fails because of an error at line 12.

    E

    Compilation fails because of an error at line 19.


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

  • 第22题:

    单选题
    Given: What is the result?()
    A

    B

    B

    The code runs with no output.

    C

    Compilation fails because of an error in line 12.

    D

    Compilation fails because of an error in line 15.

    E

    Compilation fails because of an error in line 18.


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

  • 第23题:

    单选题
    What is the result?()
    A

     Compilation succeeds and 1 is printed.

    B

     complication succeeds and 2 is printed.

    C

     An error at line 8 causes compilation to fail.

    D

     An error at line 13 causes complication to fail.

    E

     An error at line 14 causes compilation to fail.


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

  • 第24题:

    单选题
    1. interface foo {  2. int k = 0;  3. } 4.    5. public class test implements Foo (  6. public static void main(String args[]) (  7. int i;  8. Test test = new test ();  9. i= test.k;  10.i= Test.k;  11.i= Foo.k;  12.)  13.)  14.        What is the result?()
    A

     Compilation succeeds.

    B

     An error at line 2 causes compilation to fail.

    C

     An error at line 9 causes compilation to fail.

    D

     An error at line 10 causes compilation to fail.

    E

     An error at line 11 causes compilation to fail.


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