Write a program in java to demonstrate Default constructor?

class DefaultConstructor

{

                int a,b;

                public void display()

                {

                                System.out.println(a);

                                System.out.println(b);

                }

                public static void main(String arg[])

                {

                                DefaultConstructor x=new DefaultConstructor();

                                x.display();

                }

}

, , , , ,

Leave a Reply