class X { protected int amount; } class Y extends X { } class Z extends Y { int x=amount; }