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’s the difference between the methods sleep() and wait()?
Explain a situation where finally block will not be executed?
Can we use catch statement for checked exceptions when there is no chance of raising exception in our code?
Explain method overloading?
What is the difference between processes and threads?
Can we compare two strings in java?
Does constructor be static?
What is the java virtual machine?
How is string immutable in java?
Is null a value?
Explain Basics of OOP Language in java
Can you declare the main method as final?
What is hashset in java?
What is static block?
What is ascii code?