Java - MCQ
Multiple Choice Questions
Java MCQ - Introduction to Java - Set 12
56. Which of these literals can be contained in float data type variable?
A). -1.7e+308
B). -3.4e+038
C). +1.7e+308
D). -3.4e+050
View Answer
Correct: B
57. What will be the output of the following Java statement?
class output {
public static void main(String args[])
{
double a, b,c;
a = 3.0/0;
b = 0/4.0;
c=0/0.0;
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
}
A). Infinity
B). 0.0
C). NaN
D). all of the mentioned
View Answer
Correct: D
58. What is the numerical range of a char data type in Java?
A). -128 to 127
B). 0 to 256
C). 0 to 32767
D). 0 to 65535
View Answer
Correct: D
59. Which of these coding types is used for data type characters in Java?
A). ASCII
B). ISO-LATIN-1
C). UNICODE
D). None of the mentioned
View Answer
Correct: C
60. Which of these values can a boolean variable contain?
A). True & False
B). 0 & 1
C). Any integer value
D). true
View Answer
Correct: A