Consider the following program :
class Main{ public static void main (String [] args){ short s = 10; // 1 char c = s; // 2 s = c; // 3 } }
Identify the correct statements.
Select 2 options
Correct Options are : A B
Not all short values are valid char values, and neither are all char values valid short values, therefore compiler complains for both the lines 2 and 3.
They will require an explicit cast.