How are Java data types converted and promoted?
The Java Language Specification – First Edition Chapter 5 discusses conversions. There are implicit and explicit conversions. Implicit conversions use the context of the surrounding program to determine what type of conversion to perform. The explicit conversion is done with a cast. There are two types of primitive conversions widening primitive conversions and narrowing primitive conversions. Widening primitive conversions usually do not result in a loss of information and therefore don’t cause compile or runtime errors. Narrowing primitive conversions can result in a loss of information and may be illegal resulting in a compile or runtime error. See forbidden conversions for a list of conversions that are not allowed.