
class AB_Test {
	public static void main(String[] args) {
		B b = new B();
	
		b.printGreeting();

		A a = (A)b;         // b is an A, so cast is ok
		a.printGreeting();  // Dynamic dispatch calls b's instance of printGreeting

		b.printSupersGreeting();
	}
}
