xiaopan
发贴: 71
积分: 20
|
于 2003-03-17 13:25
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. }
what is the result? a.Compilation succeeds. b.Compilation fails because of an error at line4. c.Compilation fails because of an error at line6. d.Compilation fails because of an error at line14. e.Compilation fails because of an error at line17.
为什么错在17行,我在编译时告诉我5行不能声明为PRIVATE ?请高手指教
|