In java every constructor have a first statement by default super keyword.

class Pen

{

                public Pen()

                {

                                System.out.println("Stylus Pen");

                }

}

class Pin extends Pen

{

}

class Call extends Pin

{

                public Call()

                {

                                System.out.println("Call Again");

                }

                public static void main(String arg[])

                {

                                new Pen();

                                new Pin();

                                new Call();

                }

}

In java every constructor have a first statement by default super keyword.PNG

, , , , , , , ,

Leave a Reply