Consider these classes:
class Parent { int a; } class Child extends Parent { int a; // error? }
Should the declaration of a
a
It's called shadowing and may cause problems for developpers.
In your case :
Child child = new Child(); child.a = 1; System.out.println(child.a); System.out.println(((Parent)child).a);
would print
1 0