Computer Applications
What will be the resultant type of the following expression if fl is a float variable and db is a double variable?
(int) (fl + db)
Values & Data Types Java
8 Likes
Answer
The resultant data type will be int.
Explanation
Here, the programmer is performing an explicit type conversion to int using the type cast operator. Hence, the resultant data type will be int.
Answered By
3 Likes
Related Questions
What do you mean by type casting? What is type cast operator in Java?
What will be the resultant type of the following expression if bh represents a byte variable, i is an int variable, fl is a float variable and db is a double variable ?
bh - i + db / fl - i * fl + db / iDetermine the data type of the expression
If p is an int, r is a float, q is a long and s is double.
Determine the data type of the expression
if x is int, y is long, w is float, z is double, p is short and q is long double.