1. What is the range of data type short
in Java?
a) -128 to 127
b) -32768 to 32767
c) -2147483648 to 2147483647
d) None of the mentioned
2. An expression involving int, byte with
literal numbers then resulting expression will be to which of these?
a) int
b) long
c) byte
d) float
a) int
b) long
c) byte
d) float
3. Which of the following are legal
lines of Java code?
1. int w = (int)888.8;
2. byte x = (byte)1L;
3. long y = (byte)12;
4. byte z = (byte)123L;
a) 1 and 2
b) 2 and 3
c) 3 and 4
1. int w = (int)888.8;
2. byte x = (byte)1L;
3. long y = (byte)12;
4. byte z = (byte)123L;
a) 1 and 2
b) 2 and 3
c) 3 and 4