What is difference between Iterator and for loop
Answer Posted / bapi paul
An Iterator is an Object, which goes through a Collection
and you can do something with whatever the Iterator is
pointing at.
One big advantage is, that you don't have to know the size
of your Collection.
A Loop is a construct, that repeats something for a certain
amount of times.
One big advantage is, that you always know, at which
position you are.
| Is This Answer Correct ? | 62 Yes | 5 No |
Post New Answer View All Answers
What is a byte string?
Why does java not allow multiple public classes in a java file ?
Which is faster call by value or call by reference?
What is the difference between sleep and wait in java?
What is an example of a conditional statement?
enlist some features of jdk.
If system.exit (0); is written at the end of the try block, will the finally block still execute?
What is a method declaration?
Why string is not a wrapper class?
Is a class an object?
What are passing parameters?
What is the meaning of find and replace?
How to find the index of the largest number in an arraylist java?
What do you understand by classes in java?
What does || || mean in math?