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 double?
Given a singly linked list, determine whether it contains a loop or not without using temporary space?
What is stack example?
What is a ternary operator in java? What is an interface?
What is oop principle in java?
Is there any sort function in java?
When should I use stringbuffer?
Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?
What is a protected method?
Which sorting is used in arrays sort in java?
What does serializing data mean?
What is Major and importance difference between for and foreach loop ?
What are void pointers?
what is the purpose of "virtual"?
What is pojo class in java?