September 2011
Beginner
650 pages
15h 47m
English
In programming, it is common to assign one type of variable to another. For example, you might want to assign an int value to a float variable, as shown here:

When compatible types are mixed in an assignment, the value of the right side is automatically converted to the type of the left side. Thus, in the preceding fragment, the value in i is converted into a float and then assigned to f. However, because of Java’s strict type checking, not all types are compatible, and thus, not all type conversions are implicitly allowed. For example, boolean and int are not compatible.
When one type of data is assigned to another ...
Read now
Unlock full access