What is difference between Iterator and for loop

Answer Posted / tulasi ram damarla

Also, iterator is can be used with set to iterate and to
read an element from set. using for loop it is possible to
iterate,but you cannot read an element, because set does
not have a get() method.

Is This Answer Correct ?    5 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we define static methods inside interface?

743


What are green threads in java?

760


What is difference between next () and nextline () in java?

777


What is the difference between iterator and enumeration ?

770


Tell us something about different types of casting?

720


What’s the difference between unit, integration and functional testing?

837


What is difference between word and integer?

817


How can you handle java exceptions?

740


Differentiate between nested and inner class in java.

785


How would overload a function based on return type?

773


What is a string what operation can be performed out with the help of a string?

761


What do you mean by collectors in java 8?

744


Explain public static void main(string args[]) in java.

732


What is difference between null and void?

742


What’s the difference between the methods sleep() and wait()?

785