Question: Given: 5. class Atom { 6. Atom() { System.out.print(atom ); } 7. } 8. class Rock extends Atom { 9. Rock(String type) { System.out.print(type); }
Given: 5. class Atom { 6. Atom() { System.out.print("atom "); } 7. } 8. class Rock extends Atom { 9. Rock(String type) { System.out.print(type); } 10. } 11. public class Mountain extends Rock { 12. Mountain() { 13. super("granite "); 14. new Rock("granite "); 15. } 16. public static void main(String[] a) { new Mountain(); } 17. } What is the result?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
