package corejava;

class X {
	int a, b;

	X(int i, int j) {
		a = i;
		b = j;
	}

	// method to display a & b
	void show(){
		System.out.println("a and b :" + a + "" + b);
	}
}

class Y extends X {
	int c;

	Y(int i, int j, int k) {
		super(i, j);
		c = k;
	}

	void show() {
		System.out.println("c :" + c);
	}
}

public class OverrideDemo {
	public static void main(String args[]) {
		Y obj = new Y(1, 2, 3);
		obj.show();// this method invoke the show() in Y
	}
}
