Why do we need default constructor? tccicomputercoaching.com Constructor is used to initialize an object. In other words, constructor provides memory to an object. Without initializing an object we can’t use its properties. But there is no need to define or declare a default constructor in Java. The compiler implicitly adds a default constructor in the program if we have not declared or defined it.
Exampleclass Experiment { int a=10; int b=20; public static void main(String[] argus) { Experiment e=new Experiment(); //default constructor// } }