answersLogoWhite

0

Iterator.hasNext() is one of the two main methods of the Iterator interface. It can be used on an Iterator to find out if there are any remaining objects to iterate over.

For example, it would be used like this:

Iterator iter = ...;

while (iter.hasNext()) {

// do something with iter.next()...

}

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

How do you use the hasNext method in java but not have it block waiting for input?

hasNext() is a method of different classes in Java. If you mean java.util.Iterator.hasNext() or java.util.Scanner.hasNext(), it shouldn't block while waiting for input. That is part of the purpose of the hasNext() method - so that the caller can determine if there is more data without actually fetching the data.


What is vector in java?

victor is growvable object.. victor is legacy class it will support the iterator and enumarotor interfaces it is synchonyzied it will support like hasMoreElemetns and hasNext element


What is the systematic method of studying politics?

historical method observational method expermental method


Why is the NPV method superior to the Payback method?

How is the method superior to the payback method


Why is the NPV method superior to payback method?

How is the method superior to the payback method


Differences between declaring a method and calling a method?

Declaring a method is when you code for what the method will perform. When you call a method, you are using the method you have written in another part of the program, (or inside the method if it is recursive).


What are the methods in planting tree?

cone method,deep hole method,slide hole method,center hole method,trench method,slit method


How can i increase my writing method?

You can not increase a "Method". A method is a way of doing something. You could change your method, improve your method, simplify tour method, but NOT "increase" it.


Is calendar method is now a artificial family method?

No, the calendar method is a NATURAL method.


What is a sentence for method?

What is your method of study? I like your Method.


Is lowry's method an invasive method?

No. It is a non-invasive method


What is the 3 method of economic?

deductive method inductive method