The cast operator (type) is used to convert numeric values from one numeric type to another or to change an object reference to a compatible type.
WIDENING AND NARROWING CONVERSIONS
A widening conversion is a conversion from a smaller numeric type to a larger numeric type. An example of a widening conversion is when a byte value is promoted to an int value. A narrowing conversion is a conversion from a larger numeric type to a smaller numeric type. A conversion from a long value to a short value would be an example of a narrowing conversion. Narrowing conversions require the use of the cast operator.
Casting can be used to enable numeric conversions that would normally be disallowed by the compiler. For example, the following ...