Multiple Choice Question

Quiz Guidelines

 

QID: 
93
Question: 

Consider the following program :

class Test{
public static void main(String[] args){
short s = 10; // 1
char c = s; // 2
s = c; // 3
}
}

Identify the correct statements.

Select 2 options

A. Line 3 is not valid.
B. Line 2 is not valid.
C. It will compile because both short and char can hold 10.
D. None of the lines 1, 2 and 3 are valid.

Q&A Set: