Exploring the online world is my passion. have experience of #content writing #SEO #Digital Marketing #On-Page #Lead Generation #Content Analyst #Marketing Analyst... I could never stop at one point, continuously wanted to acquire more and more skills. My work for any organization will be full of passion and hard work.
Type conversion is done automatically bythe compiler. When both data typesare compatible then type conversion done bythe 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:-
int x=3; float y; y=x; // value in y=3.000
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:-
int x; byte y; y=(byte)x;
Liked By
Write Answer
What is the difference between Type Conversion and Type Casting?
Join MindStick Community
You have need login or register for voting of answers or question.
Hemant Patel
02-Mar-2017Type 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:-