public class SecondClass extends FirstClass { public SecondClass() {} public SecondClass(int a) { super(a); } public SecondClass(int a,int b2) { this(a); b = b2; } public static void main(String[] args) { FirstClass fc = new SecondClass(2,4); System.out.println("fc: "+fc); SecondClass fc2 = new SecondClass(9,7); System.out.println("fc: "+fc+" fc2: "+fc2); } } // Output: // fc: FirstClass(2,4) // fc: FirstClass(2,7) fc2: FirstClass(9,7)