1. class Super { 2. public int i = 0; 3. 4. public Super(String text) { 5. i = 1; 6. } 7. } 8. 9. public class Sub extends Super { 10. public Sub(String text) { 11. i = 2; 12. } 13. 14. public static void main(String args[]) { 15. Sub sub = new Sub(“Hello”); 16. System.out.println(sub.i); 17. } 18. }
Show comments for this question (1) Add comments Link to this question