In this example we will show how to use default constructor in Java.
Source Code
package com.beginner.examples;
public class ConstructorExample {
public ConstructorExample(){
System.out.println("Default constructor");
}
public static void main(String a[]){
ConstructorExample o1 = new ConstructorExample();
}
}
Output:
Default constructor