Automatic Conversions : Data Type Cast : Data Type C# Examples


C# Examples » Data Type » Data Type Cast »

 

Automatic Conversions





An automatic type conversion will take place if

The two types are compatible.
The destination type is larger than the source type.

When these two conditions are met, a widening conversion takes place.
For example, the int type is always large enough to hold all valid byte values
Both int and byte are integer types, so an automatic conversion can be applied.



HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Data Type Cast