ICSE Class 9 Computer Applications Question 11 of 21

Operators in Java — Question 11

Back to all questions
11
Question

Question 11

What is typecasting in Java? Give an example.

Answer

The process of converting a value of one data type to another data type is called typecasting. For example:

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