This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Tough Chisholm Question! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Tough Chisholm Question!" Watch "Tough Chisholm Question!" New topic
Author

Tough Chisholm Question!

Anthony Roy
Greenhorn

Joined: Oct 08, 2003
Posts: 8
Exam 17, Q2
import java.util.*;
class I {
public static void main (String[] args) {
Object i = new ArrayList().iterator();
System.out.print((i instanceof List)+",");
System.out.print((i instanceof Iterator)+",");
System.out.print(i instanceof ListIterator);
}}
Are we really expected to know *how* the Collection classes are implemented?
The result of i instanceof ListIterator returns false in this case. However, if the collection was instead a LinkedList, it would return true! (LinkedList simply forwards its iterator method to its listIterator method.
I think a fairer question would be based merely around the Iterators themselves assuming that it wishes to test knowledge of which of the iterators is a subinterface of which.
Thanks to Dan BTW for creating so many questions which really make you think! I've been scoring in the 90-100% mark in most of the other test exams I've taken - it's been down to 60-75% on average on Dan's questions...


Ant...<br /><a href="http://www.antroy.co.uk" target="_blank" rel="nofollow">www.antroy.co.uk</a>
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
After thinking about this, I don't think that this level of detail is something that you really need to know for the test.
[ October 17, 2003: Message edited by: Thomas Paul ]

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
Anthony,
I think you're right. That question is a little beyond the scope. I'll replace it with a new question sometime soon.


Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Thanks to Dan BTW for creating so many questions which really make you think! I've been scoring in the 90-100% mark in most of the other test exams I've taken - it's been down to 60-75% on average on Dan's questions...
You're more than ready for the exam


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Anthony Roy
Greenhorn

Joined: Oct 08, 2003
Posts: 8
You're more than ready for the exam

Cool - it's on Tuesday
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
I agree. You're more than ready.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tough Chisholm Question!