SCJP Test 2 - Online Test

Test Difficulty Level: Medium

Syllabus of Test

Sample Question from this online test:

Question: 1. boolean bool = true;
2. if(bool = false) {
3. System.out.println(“a”);
4. } else if (bool) {
5. System.out.println(“c”);
6. } else if (!bool) {
7. System.out.println(“c”);
8. } else {
9. System.out.println(“d”);
10. }
What is the result?

Option A: a

Option B: b

Option C: c

Option D: d

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

Start this Test






Comments

srikanth reddy on 2011-07-08 19:37:23 wrote,

should provide explanations for better understading.......

Devapriya Sur on 2012-07-31 04:45:46 wrote,

The test standard is OK, but there is come flaw in q14. I compiled it in eclipse and found the result series given here doesnt match the actual result....please be carefull about such mistakes....coz we are depending on your assessment only...

Makara Reddy on 2012-08-08 11:44:57 wrote,

Question 15 :
1. public Object m() {
2. Object o = new Float(3.14F);
3. Object [] oa = new Object[1];
4. oa[0] = o;
5. o = null;
6. return oa[0];
7. }
When is the Float object, created in line 11, eligible for garbage collection?

Line 11 is not there :( can you please change ?