Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tough Chisholm Question!

 
Anthony Roy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anthony,
I think you're right. That question is a little beyond the scope. I'll replace it with a new question sometime soon.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Anthony Roy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're more than ready for the exam

Cool - it's on Tuesday
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree. You're more than ready.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic