单选题} What is the result?()ACompilation succeeds and 1 is printed.BCompilation succeeds and 2 is printed.CAn error at line 8 causes compilation to fail.DAn error at line 14 causes compilation to fail.

题目

单选题} 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
解析: 暂无解析
更多“单选题} 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.”相关问题
  • 第1题:

    class A {   public byte getNumber () {   return 1;   }   }   class B extends A {   public short getNumber() {   return 2;   }    public static void main (String args) {   B b = new B ();    System.out.printIn(b.getNumber())  }   }   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.

    正确答案:C

  • 第2题:

    1. class A {  2. public String toString ()  {  3. return “4”;  4. }  5. }  6. class B extends A {  7. public String toString ()   {  8. return super.toString()  + “3”;  9. }  10. }  11. public class Test {  12.   public static void main(String[]args)  {  13.      System.out.printIn(new B());  14.      }  15. }    What is the result?()  

    • A、 Compilation succeeds and 4 is printed.
    • B、 Compilation succeeds and 43 is printed.
    • C、 An error on line 9 causes compilation to fail.
    • D、 An error on line 14 causes compilation to fail.
    • E、 Compilation succeeds but an exception is thrown at line 9.

    正确答案:B

  • 第3题:

    1. class A {  3. public String to String() {  4. return “4”;  5. }  6. }  7. class B extends A {  8. public String toString() { 9. return super.toString() + “3”;  10. }  11. }  12. public class Test {  13. public static void main (String[] args) {  14. System.out.printIn(new B()); 15. }  16. }   What is the result( )?  

    • A、 Compilation succeeds and 4 is printed.
    • B、 Compilation …………… is printed.
    • C、 An error on line 9 cause compilation to fail.
    • D、 An error on line 14 cause compilation to fail.
    • E、 Compilation succeeds but an exception is thrown at line 9.

    正确答案:B

  • 第4题:

    class A {   public int getNumber(int a) {   return a + 1;   }   }    class B extends A {   public int getNumber (int a) {   return a + 2   }    public static void main (String args) {   A a = new B();   System.out.printIn(a.getNumber(0));   }   }   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 13 causes compilation to fail.
    • E、 An error at line 14 causes compilation to fail.

    正确答案:B

  • 第5题:

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

  • 第6题:

    单选题
    abstract class abstrctIt {  abstract float getFloat ();  } public class AbstractTest extends AbstractIt { private float f1= 1.0f;  private float getFloat () {return f1;}  }   What is the result?()
    A

     Compilation is successful.

    B

     An error on line 6 causes a runtime failure.

    C

     An error at line 6 causes compilation to fail.

    D

     An error at line 2 causes compilation to fail.


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

  • 第7题:

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

  • 第8题:

    单选题
    class A {   public byte getNumber () {   return 1;   }   }   class B extends A {   public short getNumber() {   return 2;   }    public static void main (String args) {   B b = new B ();    System.out.printIn(b.getNumber())  }   }   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.


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

  • 第9题:

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

     Compilation succeeds and l is printed.

    B

     Compilation succeeds and 2 printed.

    C

     An error at line 8 cause compilation to fail.

    D

     An error at line 14 cause complication to fail.

    E

     Complication succeeds but an exception is thrown at line 14.


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

  • 第10题:

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

  • 第11题:

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

  • 第12题:

    单选题
    class A {   public String toString () {   return “4”;   }   }   class B extends A {   8. public String toString () {   return super.toString() + “3”;   }   }   public class Test {   public static void main(Stringargs) {   System.out.printIn(new B());   }   }   What is the result?()
    A

     Compilation succeeds and 4 is printed.

    B

     Compilation succeeds and 43 is printed.

    C

     An error on line 9 causes compilation to fail.

    D

     An error on line 14 causes compilation to fail.

    E

     Compilation succeeds but an exception is thrown at line 9.


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

  • 第13题:

    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.

    正确答案:B

  • 第14题:

    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

  • 第15题:

    1. class A {  2. public byte file Number ( ) { 3. return l;  4. }  5. }  6.  7. Class B extends A {  8. public short getNumber( ) {  9.  return 2;  10. }  11.  12. public short getNumber( ) {  13. B b = new B( );  14. System.out.printIn(b.getNumber( ));  15. }  16. }   What is the result()?  

    • A、 Compilation succeeds and l is printed.
    • B、 Compilation succeeds and 2 printed.
    • C、 An error at line 8 cause compilation to fail.
    • D、 An error at line 14 cause complication to fail.
    • E、 Complication succeeds but an exception is thrown at line 14.

    正确答案:C

  • 第16题:

    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

  • 第17题:

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

  • 第18题:

    单选题
    1. class A {  2. public String toString ()  {  3. return “4”;  4. }  5. }  6. class B extends A {  7. public String toString ()   {  8. return super.toString()  + “3”;  9. }  10. }  11. public class Test {  12.   public static void main(String[]args)  {  13.      System.out.printIn(new B());  14.      }  15. }    What is the result?()
    A

     Compilation succeeds and 4 is printed.

    B

     Compilation succeeds and 43 is printed.

    C

     An error on line 9 causes compilation to fail.

    D

     An error on line 14 causes compilation to fail.

    E

     Compilation succeeds but an exception is thrown at line 9.


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

  • 第19题:

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


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

  • 第20题:

    单选题
    class A {   public int getNumber(int a) {   return a + 1;   }   }    class B extends A {   public int getNumber (int a) {   return a + 2   }    public static void main (String args) {   A a = new B();   System.out.printIn(a.getNumber(0));   }   }   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 13 causes compilation to fail.

    E

     An error at line 14 causes compilation to fail.


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

  • 第21题:

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

  • 第22题:

    单选题
    1. class A {  3. public String to String() {  4. return “4”;  5. }  6. }  7. class B extends A {  8. public String toString() { 9. return super.toString() + “3”;  10. }  11. }  12. public class Test {  13. public static void main (String[] args) {  14. System.out.printIn(new B()); 15. }  16. }   What is the result( )?
    A

     Compilation succeeds and 4 is printed.

    B

     Compilation …………… is printed.

    C

     An error on line 9 cause compilation to fail.

    D

     An error on line 14 cause compilation to fail.

    E

     Compilation succeeds but an exception is thrown at line 9.


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

  • 第23题:

    单选题
    1. class A {  2. public int getNumber(int a) {  3.     return a + 1;  4. }  5. }  6.    7. class B extends A {  8. public int getNumber (int a) {  9. return a + 2  10. }  11.    12. public static void main (String args[])  {  13. A a = new B();  14. System.out.printIn(a.getNumber(0));  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 13 causes compilation to fail.

    E

     An error at line 14 causes compilation to fail.


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

  • 第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
    解析: 暂无解析