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 mutual exclusion? : Java thread
What is difference between == and === in js?
Can a class extends itself in java?
How many types of threads are there in java?
What should I import for arraylist in java?
What sorting algorithm does javascript use?
What is a flag value?
In java, how we can disallow serialization of variables?
Is string an object?
How many ways can we create singleton class?
What is an enumeration?
Can we create object of static class?
Can java list be null?
Explain the difference between abstract classes and interfaces in java?
What is the static method?