/* Program Test_OR.java shows method overriding */
class Point {
	int x =0;
	int y = 0;
	
	void move(int x, int y) {
		System.out.println("I am Point mover");
		this.x = x; 
		this.y = y; 
	}

	int getX() { return x; }
}

class RealPoint extends Point {
	float x = 10.0f;
	float y = 10.0f;

	void move(int x, int y) {
		System.out.println("I am RealPoint mover");
		this.x = (float) x;
		this.y = (float) y; 
	}

	void super_move() { super.move(100,100); }
}


class Test_OR {
	public static void main(String[] args) {
		RealPoint rp = new RealPoint();
		Point p = rp;

		p.move(2, 2);
		System.out.println("p.x y = " + p.x + " " +p.y);
		System.out.println("rp.x y = " + rp.x + " " + rp.y);

		rp.move(2, 2);
		System.out.println("p.x y = " + p.x + " " +p.y);
		System.out.println("rp.x y = " + rp.x + " " + rp.y);

		rp.super_move();
		System.out.println("p.x y = " + p.x + " " +p.y);
		System.out.println("rp.x y = " + rp.x + " " + rp.y);




	}
}

