Page 1 out of 12. Viewing questions 1-15 out of 190
Question 1
Given the code fragment: What is the result?
A.
2012-02-10
B.
2012-01-30
C.
2012-02-10 00:00
D.
A DateTimeException is thrown at runtime.
Answer:
C
User Votes:
A 1 votes
50%
B
50%
C
50%
D
50%
Discussions
0/ 1000
Question 2
Given: What is the result?
A.
Compilation fails.
B.
false true
C.
true false
D.
true true
E.
false false
Answer:
C
Explanation:
User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
0/ 1000
Question 3
Given the definitions of the MyString class and the Test class: What is the result?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
E.
Option E
Answer:
D
User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
0/ 1000
Question 4
Given: What is the result?
A.
BaseDerivedA
B.
BaseDerivedB
C.
DerivedBDerivedB
D.
DerivedBDerivedA
E.
A ClassCastException is thrown at runtime.
Answer:
D
User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
0/ 1000
Question 5
Given the code fragment: What is the result?
A.
Answer = 0
B.
Invalid calculation
C.
Compilation fails only at line n1.
D.
Compilation fails only at line n2.
E.
Compilation fails at line n1 and line2.
Answer:
C
Explanation:
User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
0/ 1000
Question 6
Given the code fragment: Which option represents the state of the num array after successful completion of the outer loop? A. Option A B. Option B C. Option C D. Option D
Answer:
B
Discussions
0/ 1000
Question 7
Given: What is the result?
A.
AB
B.
AC
C.
CC
D.
A ClassCastException is thrown only at line n1.
E.
A ClassCastException is thrown only at line n2.
Answer:
D
User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
0/ 1000
Question 8
Given the code fragment: Which modification enables the code to print 54321?
A.
Replace line 6 with System.out.print (--x);
B.
At line 7, insert x --;
C.
Replace line 5 with while (is Available(--x)) {
D.
Replace line 12 with return (x > 0) ? false : true;
Answer:
C
User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
0/ 1000
Question 9
Given: What is the result?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
Answer:
A
User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
0/ 1000
Question 10
Given the code fragment: Test.java: Which is the result?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
E.
Option E
Answer:
D
User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
0/ 1000
Question 11
Given the code fragment: What is the result?
A.
An exception is thrown at runtime.
B.
2014-07-31T01:01:00
C.
2014-07-31
D.
2014-09-30T00:00:00
Answer:
B
User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
0/ 1000
Question 12
Given the code fragment: What is the result?
A.
A B C
B.
A B C D E
C.
A B D E
D.
Compilation fails.
Answer:
D
User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
0/ 1000
Question 13
Given the code fragment: Which code fragment, when inserted at line n1, enables the App class to print Equal?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
Answer:
B
User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
0/ 1000
Question 14
Given: What is the result?
A.
97 9899 100 null null null
B.
97 9899 100 101 102 103
C.
Compilation fails.
D.
A NullPointerException is thrown at runtime.
E.
An ArraylndexOutOfBoundsException is thrown at runtime.