Java - MCQ
Multiple Choice Questions
Java MCQ - Introduction to Java - Set 11
51. What is the extension of compiled java classes?
A). .class
B). .java
C). .txt
D). .js
View Answer
Correct: A
52. What is the range of short data type in Java?
A). -128 to 127
B). -32768 to 32767
C). -2147483648 to 2147483647
D). None of the mentioned
View Answer
Correct: B
53. What is the range of byte data type in Java?
A). -128 to 127
B). -32768 to 32767
C). -2147483648 to 2147483647
D). None of the mentioned
View Answer
Correct: A
54. Which of the following are legal lines of Java code?
1. int w = (int)888.8;
2. byte x = (byte)100L;
3. long y = (byte)100;
4. byte z = (byte)100L;
A). 1 and 2
B). 2 and 3
C). 3 and 4
D). All statements are correct
View Answer
Correct: D
55. An expression involving byte, int, and literal numbers is promoted to which of these?
A). int
B). long
C). byte
D). float
View Answer
Correct: A