MCQ The value of the expression (int) 27.6 evaluates to: a) b) c) d) e) 27Error Answer = B.

Download Report

Transcript MCQ The value of the expression (int) 27.6 evaluates to: a) b) c) d) e) 27Error Answer = B.

MCQ
The value of the expression (int) 27.6 evaluates to:
a)
b)
c)
d)
e)
28
27
26
Error
6
Answer = B
27
1
MCQ2
What is the value of the variable c in the statements that
follow?
String phrase = "Make hay while the sun is shining.";
char c = phrase.charAt(3);
a)
b)
c)
d)
M
a
k
e
Answer = D
e
2
MCQ3
What is the value of the variable c in the statements that
follow?
String phrase = "Make hay while the sun is shining.";
int c = phrase.indexOf('a');
a)
b)
c)
d)
1
-1
6
20
Answer = A
1
3
MCQ4
What is the output of the following code fragment?
String phrase = "123";
int c = Integer.parseInt(phrase);
System.out.println(c*2);
Answer = 246
4
MCQ5
What is the output of the following code fragment?
String phrase = "123";
System.out.println(phrase*2);
Compile time error
5