public class Test {
public static void main(String[] args) {
T t = new T3();
T1 t1 = new T3();
T2 t2 = new T3();
T3 t3 = new T3();
System.out.println(t.a);
System.out.println(t1.a);
System.out.println(t2.a);
System.out.println(t3.a);
System.out.println(((T) t).a);
System.out.println(((T1) t).a);
System.out.println(((T2) t).a);
System.out.println(((T3) t).a);
}
}
class T {
int a = 0;
}
class T1 extends T {
int a = 1;
}
class T2 extends T1 {
int a = 2;
}
class T3 extends T2 {
int a = 3;
}