Computer Applications

What do you mean by type casting? What is type cast operator in Java?

Values & Data Types Java

17 Likes

Answer

The explicit conversion of an operand to a specific type is called Type Casting.

Type Casting in Java is done using the type cast operator. It is a unary operator. It's syntax is:

(<target datatype>) <value>

For example :

int a = 10;
double b = 25.5;
float c = (float)(a + b);

Answered By

10 Likes


Related Questions