class SuperX { public double dd = 3.14d; public int aa = 10; } class SubY extends SuperX { public int dd() { return 6;} public static double dd = 5.07d; public int aa = 0; } class SubZ extends SubY { public static void main(String[] args) { SubZ foo = new SubZ(); foo.printName(); } public short dd = 9; void printName() { super.aa = 7; SuperX v = (SuperX)this; v.aa = 17; System.out.println(super.aa); // 7 System.out.println(((SuperX)this).aa); // 17 System.out.println(((SuperX)this).dd); // 3.14 System.out.println(super.dd); // 5.07 System.out.println(super.dd()); // 6 System.out.println(this.dd); // 9 System.out.println(dd()); // 6 } } /* output 7 17 3.14 5.07 6 9 6 */