Long y = ( int ) 2 what type of casting
Answers
Answered by
3
Answer:
please make brilliant and follow me and like me
Explanation:
TYPE CASTING is nothing but the new way of converting a data type of one variable to some other datatype. typecasting is characterized into two types
IMPLICIT TYPECASTING: in this implicit typecasting done by the compiler and there is no loss of information
EXPLICIT TYPECASTING: in this explicit typecasting is done by the programmer and there will be a loss of information.
EXAMPLE:
float x=5.5;
int y=(int)x;
in this code, the second statement will typecast the x from float to integer value and the value of y will be 5, however, there will be no change on the original x value.
Similar questions