SCJP Test - 5 - Online Test

Test Difficulty Level: Medium

Syllabus of Test

Questions based on SCJP

Sample Question from this online test:

Question: 1. public class Test {
2. public static void add3 (Integer i) {
3. int val = i.intValue();
4. val += 3;
310 - 035
Leading the way in IT testing and certification tools, www.testking.com
-51 -
5. i = new Integer(val);
6. }
7.
8. public static void main(String args[]) {
9. Integer i = new Integer(0);
10. add3(i);
11. System.out.println(i.intValue());
12 }
13 }
What is the result?

Option A: Compilation fails

Option B: An exception is thrown at runtime.

Option C: 0

Option D: 3

To answer, click the "Start This Test" button below.

Start this Test






Comments

No comment yet. Be the first to post a comment.