1、选择题1:1.What will happen when you attempt to compile and run the following code? 2. 3.class Base 4. 5.{ 6. 7.int i = 99; 8. 9.public void amethod() 10. 11.{ 12. 13. System.out.println("Base.amethod()"); 14. 15. } 16. 17. Base() 18. 19.{ 20. 21. ameth
2、od(); 22. 23. } 24. 25.} 26. 27.public class Derived extends Base 28. 29.{ 30. 31.int i = -1; 32. 33. 34. 35.public static void main(String argv[]) 36. 37.{ 38. 39. Base b = new Derived(); 40. 41. System.out.println(b.i); 1. 2. b.amethod();
5、mpiletimeerrorD.Derived.amethod()2:1.Which is the most appropriate code snippet that can be inserted at line 18 in the following code? 2. 3.(Assume that the code is compiled and run with assertions enabled) 4. 5.1. import java.util.*; 6. 7.2. 8. 9.3. public class AssertTest 10.