This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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
Don't get me started about those stupid light bulbs.
subject: Iterator in lists
It's not a secret anymore!