What will be the result of the following code execution?

class Super {
    Super() {
        System.out.println("Super contructor");
    }
}

public class Main extends Super {
    Main() {
        this(1);
        System.out.println("Main() contructor");
    }
    Main(int i) {
        System.out.println("Main(int) contructor");
    }
    public static void main(String [] args) {
        new Main();  
    }
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes