class Demo { Demo( ) { System.out.println("This is NOPC"); } Demo(int x) { System.out.println("This is 1PC"); } Demo(int x,int y) { System.out.println("This is 2PC"); } } public class Main { public static void main(String args[]) { Demo d1=new Demo(); Demo d2=new Demo(10); Demo d3=new Demo(10,20); } }
This is NOPC
This is 1PC
This is 2PC