Java - Type casting Overview
Q1.
Which of the following is an example of widening typecasting?
Q2.
What is required for narrowing typecasting in Java?
Q3.
Which of the following is true about upcasting in Java?
Q4.
What will be the output of the following code?
double d = 9.7;
int i = (int) d;
System.out.println(i);
Q5.
Which of the following may throw a ClassCastException at runtime?