SCJP Test - 11 - 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 main (String[]args) {
3. String foo = args[1];
4. String bar = args[2];
5. String baz = args[3];
6. System.out.printIn(“baz = ” + baz);
7. }
8. }
And the output:
Baz = 2
Which command line invocation will produce the output?

Option A: Java Test 2222

Option B: Java Test 1 2 3 4

Option C: Java Test 4 2 4 2

Option D: Java Test 4 3 2 1

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

Start this Test






Comments

amitesh Tomar on 2012-01-17 09:56:11 wrote,

ques 18 answer is wrong as u write storedSet in place of s
ortedSet

jainendra pathak on 2012-01-17 12:01:22 wrote,

Question 7 :at line 5: if (s2.equals(b1)) {// s2 is not define so it will give compilation error.So correct Answer will be Option C i.e.
An error at line 5 causes compilation to fail. not A.Check it and modify it ..