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