black

SCJP程序员认证考试

登录

单项选择题

1. package foo; 
2.   
3. import java.util.Vector; 
4.   
5. private class MyVector extends Vector { 
6. int 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. }    
The file MyNewVector.java is shown in the exhibit.  What is the result?()  

A. Compilation will succeed.
B. Compilation will fail at line 5.
C. Compilation will fail at line 6.
D. Compilation will fail at line 14.
E. Compilation will fail at line 17.

相关考题

单项选择题 class super {  public int getLength()  {return 4;}  }  public class Sub extends Super {  public long getLength() {return 5;}  public static void main (String[]args)  {  super sooper = new Super ();  Sub sub = new Sub();  System.out.printIn(  sooper.getLength()+ “,” + sub.getLength()   };  }  What is the output?()

多项选择题 Whichtwostatementsaretrueregardingthecreationofadefaultconstructor?()

单项选择题 1. public class ArrayTest {  2. public static void main (String[]args)  {  3. float f1[], f2[];  4. f1 = new float [10];  5. f2 = f1;  6. System.out.printIn (“f2[0]=” + f2[0]);  7.  }  8. }   What is the result?()

All Rights Reserved 版权所有©建筑考试题库(jzkao.com)

备案号:湘ICP备2020024380号-3