Compilation succeeds and 1 is printed.
complication succeeds and 2 is printed.
An error at line 8 causes compilation to fail.
An error at line 13 causes complication to fail.
An error at line 14 causes compilation to fail.
第1题:
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?()
第2题:
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?()
第3题:
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?()
第4题:
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()?
第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? ()
第6题:
An exception is thrown.
The program exists without printing anything.
An error at line 1 causes compilation to fail.
An error at line 2 causes the compilation to fail.
“Running” is printed and the program exits.
第7题:
Compilation succeeds and 4 is printed.
Compilation succeeds and 43 is printed.
An error on line 9 causes compilation to fail.
An error on line 14 causes compilation to fail.
Compilation succeeds but an exception is thrown at line 9.
第8题:
Compilation succeeds and 1 is printed.
Compilation succeeds and 2 is printed.
An error at line 8 causes compilation to fail.
An error at line 14 causes compilation to fail.
Compilation succeeds but an exception is thrown at line 14.
第9题:
Compilation succeeds and l is printed.
Compilation succeeds and 2 printed.
An error at line 8 cause compilation to fail.
An error at line 14 cause complication to fail.
Complication succeeds but an exception is thrown at line 14.
第10题:
Compilation succeeds and 1 is printed.
Compilation succeeds and 2 is printed.
An error at line 8 causes compilation to fail.
An error at line 14 causes compilation to fail.
第11题:
Compilation succeeds and 1 is printed.
Compilation succeeds and 2 is printed.
An error at line 8 causes compilation to fail.
An error at line 13 causes compilation to fail.
An error at line 14 causes compilation to fail.
第12题:
Compilation succeeds.
An error at line 2 causes compilation to fail.
An error at line 9 causes compilation to fail.
An error at line 10 causes compilation to fail.
An error at line 11 causes compilation to fail.
第13题:
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? ()
第14题:
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?()
第15题:
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( )?
第16题:
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? ()
第17题:
Compilation succeeds.
An error at line 2 causes compilation to fail.
An error at line 9 causes compilation to fail.
An error at line 10 causes compilation to fail.
An error at line 11 causes compilation to fail.
第18题:
Compilation is successful.
An error on line 6 causes a runtime failure.
An error at line 6 causes compilation to fail.
An error at line 2 causes compilation to fail.
第19题:
Compilation succeeds and 1 is printed.
Compilation succeeds and 2 is printed.
An error at line 8 causes compilation to fail.
An error at line 14 causes compilation to fail.
Compilation succeeds but an exception is thrown at line 14.
第20题:
Compilation succeeds and 1 is printed.
Compilation succeeds and 2 is printed.
An error at line 8 causes compilation to fail.
An error at line 13 causes compilation to fail.
An error at line 14 causes compilation to fail.
第21题:
Compilation succeeds.
Compilation fails due to multiple errors.
Compilation fails due to an error only on line 20.
Compilation fails due to an error only on line 21.
Compilation fails due to an error only on line 22.
Compilation fails due to an error only on line 12.
第22题:
Compilation succeeds and 4 is printed.
Compilation …………… is printed.
An error on line 9 cause compilation to fail.
An error on line 14 cause compilation to fail.
Compilation succeeds but an exception is thrown at line 9.
第23题:
Compilation succeeds and 4 is printed.
Compilation succeeds and 43 is printed.
An error on line 9 causes compilation to fail.
An error on line 14 causes compilation to fail.
Compilation succeeds but an exception is thrown at line 9.