I have a class C. Class E extends it.
E e = new E();
C c = new C();
Why is
e = (E) c;
Upon further review
You can't cast objects in Java.
You can cast references in Java.
Casting a reference doesn't change anything about the object it refers to. It only produces a reference of a different type pointing to the same object as the initial reference.
Casting primitive values is different from casting references. In this case the values do change.