First page Back Continue Last page Graphics
Java Type Checking
In a Java assignment statement, the type of the variable on the left hand side must be "wider" than the type of the expression on the right
Suppose d is of type double, i is of type int, super is a class variable of type SuperClass, and sub is a class variable of type SubClass where SubClass extends SuperClass:
- d = i; // OK
- i = d; // NO
- super = sub; // OK
- sub = super; // NO