What is the difference between Type Conversion and Type Casting?
Ask by Hemant Patel
Updated 24 Sep 2020
Type conversion is done automatically by the compiler. When both data types are compatible then type conversion done by the compiler. Type conversion done explicitly while compiling. It’s widening conversion type. In type conversion destination type must be larger than source type. For Example:-
But Type Casting is to be “explicitly done” by the programmer. It’s also applied to two ‘incompatible’ data types. Type casting required a casting operator. Destination type must be smaller than the source type in Type Casting.
For Example:-