Java-Constructor Execution

Constructor Execution A super class constructor should be executed before a subclass constructor is executed. Only then, an object of a subclass will be properly initialized. Program Program Source class Super { Super() { System.out.println(“Super class constructor”); } } class Sub extends Super{ Sub() { System.out.println(“Sub class constructor”); } } public class Javaapp { public … Read more…