The predefined types also have predefined conversions. For instance, conversions exist between the predefined types int and long. C# differentiates between two kinds of conversions: implicit conversions and explicit conversions. Implicit conversions are supplied for conversions that can safely be performed without careful scrutiny. For instance, the conversion from int to long is an implicit conversion. This conversion always succeeds, and never results in a loss of information. The following example implicitly converts an int to a long.
In contrast, explicit conversions are performed with a cast expression. The example uses an explicit conversion to convert a long to an int. The output is: because an overflow occurs. Cast expressions permit the use of both implicit and explicit conversions.