Two numeric but different base types: byte, short, long, float, double cannot be added without first converting one of them so that values of the same numeric type added.
Conversions can be made between any of these types with the possible loss of precision due to the differences in size or representation.
The types have an ordering:
byte -> short -> int -> long -> float -> double A conversion of any one of these types to a type farther to the right in the ordering is called a widening conversion. A conversion of one type to a type to its left is called a narrowing conversion. Widening conversions are done automatically by the compiler. byte b = 127; short s; s = b; // Ok. A widening conversion byte -> short Narrowing conversions require a cast. short s = 512; byte b; b = (byte) s;