answersLogoWhite

0

Where is it possible to get a Java iterator?

Updated: 8/20/2019
User Avatar

Wiki User

10y ago

Best Answer

The Oracle website has a step by step pattern that shows how to obtain an iterator for use with Java programming. HashMap can also be helpful with explaining the looping sequence.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Where is it possible to get a Java iterator?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are the various functions in iterator class in java?

There are mainly three Methods available in the iterator class in java. Namely they are ... 1. Has Next 2. Next and 3. Remove.


Define iterator in java?

An Iterator is a java feature using which we can loop through every single element of a collection and perform operations on them. It is extremely useful because we don't have to worry about the collection size or whether we will get index out of bounds exceptions while looping through a collection Ex: ArrayList lst = new ArrayList(); //code that populates the list Iterator ir = lst.iterator(); Here itr is the iterator that will help the code loop through each element of the collection.


What is difference Iterator and Enumeration?

1.Iterator has remove method while enumeration doesn't have it. 2.Iterator is new in Java API but Enumeration is older one. 3. Iterator extends functionality of Enumeration. 4. Iterator is more secure and safe as compared to Enumeration because it does not allow other thread to modify the collection object while some thread is iterating over it and throws ConcurrentModificationException.


What is Re usability in java?

Reusability in Java means that once you write some code, you can use it over and over again - if you write it so that it can be reused. For example, if you write a Enumeration-Iterator adapter, or some code that lets you treat an Enumeration - Java legacy code - as an Iterator - shiny NEW Java code - then you can use it not only in your animal simulation program, but also in your Jacuzzi interface program.


Is it possible to iterate multiple items over a iterator?

No. An iterator can be used to iterate through only one collection. to iterate through multiple collections you must use multiple iterators.


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


Operator overloading is possible in java or not?

Java does not support opperator overloading, so the answer to your question is: none.


Is it possible to run java program without JVM?

No. Java programs run in the Java Virtual Machine (JVM) - without it your computer won't know how to handle Java bytecode.


Can you do java keylogger?

Yes, it is possible to write a keylogger in Java, but you would need to use the Java Native Interface to do so.


Is Iterator a class or Interface?

Its an interface.


Is it possible to draw in java without using applet?

Yes it is possible to draw in java by using AWT package. or by using javax package.


What is the hasnext method?

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()... }