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
Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).
How are the elements of a gridbaglayout organized in java programming?
What is your platform’s default character encoding?
What are the ways in which a thread can enter the waiting state?
How many types of methods are there?
What is the use of arrays tostring () in java?
What is api in java?
Explain the difference between treeset and treemap in java?
Is there any case when finally will not be executed?
Which is easier .net or java?
Is arraylist ordered?
What is the this keyword?
What is variable and constant explain with example?
Which sorting algorithm is best in java?
What is a numeric string?