import java.util.*;

public class App {
	public static void main(String [] args) {
		System.out.println("Receiver SupC supC");
		SupC supC = new SupC();
		supC.f();
		supC.f(1);
		System.out.println();
		
		System.out.println("Receiver SubC subC");
		SubC subC = new SubC();
		subC.f();
		subC.f(1);
		subC.f(2.0);
		System.out.println();

		System.out.println("Receiver supC = subC");
		supC = subC;	// upcast
		supC.f();
		supC.f(1);
		//supC.f(2.0);	// illegal, no suych method in supC
	}
}
