File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Iterator in lists Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Iterator in lists" Watch "Iterator in lists" New topic

Iterator in lists

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Iterator<Dog> i3 = d.iterator();

List<Dog> d = new ArrayList<Dog>();

Dog is a class.

what does d.iterator do ?

OCPJP 6.0 93%
OCPJWCD 5.0 98%
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

what does d.iterator do ?

It returns an Iterator. If you don't know what an Iterator is, check the API of java.util.Iterator.

[My Blog]
All roads lead to JavaRanch
jQuery in Action, 3rd edition
subject: Iterator in lists
jQuery in Action, 3rd edition