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

Iterator in TestNG class

justin hoffer

Joined: Jun 08, 2011
Posts: 1
If a class implements iterator interface, it provides next() and hasnext(). Do these next() and hasnext() get called automatically when the class's object is created?

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33106

Welcome to CodeRanch!

No. next() and hasNext() are not called automatically on an iterator.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Iterator in TestNG class
jQuery in Action, 3rd edition