Q29. What do you mean by type casting? What is type cast operator?
Ans. The explicit conversion of an operand to a specific type is called Type Casting.
Type casting in Java is done as shown below:
where type is a valid Java data type to which the conversion is to be done. For example, to make sure that the expression (x+y/2) evaluates to type float, write it as:
casts ate often considered as operators. As an operator, a cast is unary and has the same precedence as any other unary operator.