Q45
What will be output of the following program code? public class Test public static void main(String[] a) short x = 10; x = x*5; System.out.print(x);
A.
50
B.
10
C.
Compilation Error
AnswerD.
None of these
Answer: Option C
Solution
Answer: Option C
Solution:
lossy conversion from int to shortx = x*5;
^
1 error