SCJP Test - 6 - Online Test

Test Difficulty Level: Medium

Syllabus of Test

Questions based on SCJP

Sample Question from this online test:

Question: 11. ArraryList a = new ArrayList();
12. a.add(“Alpha”);
13. a.add(“Bravo”):
14. a.add(“Charlie”);
15. a.add(“Delta”);
16.Iterator iter = a.iterator();
Which two, added at line 17, print the names in the ArrayList in alphabetical order?
(Choose two)
A. for (int i=0; i< a.size(); i++)
B. for (int i=0; i< a.size(); i++)
C. while( iter.hasNext() )
System.out.println( ;
D. for (int i=0, i< a.size(); i++)
E. for (int i=0; i< a.size(); i++)

Option A: A, C

Option B: A, B

Option C: A, D

Option D: A, E

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

Start this Test


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