• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ArrayList can be iterated bidirectionaly!

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

#176 Which three are true for class java.util.ArrayList? (Choose three.)


(1) It can contain duplicates
(2) Its methods are thread-safe
(3) Can be iterated bi-directionally <--
(4) It implements java.util.Set
(5) It is well-suited for fast random access
(6) It implements java.util.Collections



Source: "Giri Mandarika" (Link provided in JavaRanch)

How option 3?

Is option 3 talking about ListIterator, because only that can be used to iterate the list bidirectionally?

Is ListIterator in the exam? It is Iterator (with two methods hashNext() and next() as I know), that is discussed in K&B!



Please Help?

Regards,
cmbhatt
 
Burkhard Hassel
Ranch Hand
Posts: 1274
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,

Chandra asked
Is option 3 talking about ListIterator?

Must be, yes. ListIterator has got the hasPrevious() method that the ordinary Iterator does not have.

But since you obviously know this, I wouldn't care if ListIterator on the exam.


Yours,
Bu.
 
madhu v pe
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chandra,

Are you preparing for SCJP1.5 ? if so, pls specify your exam date.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic