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 a variable be local and static at the same time?

547


What does .equals do in java?

529


What is the difference between interface & abstract class?

561


Can we cast any other type to boolean type with type casting?

540


I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in

1600






5 Coding best practices you learned in java?

640


What is the epoch date?

571


Is void a wrapper class?

537


Explain restrictions for using anonymous inner classes?

589


What is a java list?

587


Can we write multiple catch blocks under single try block?

577


Why object class is super class for every class in java?

578


What is anagram of a string?

520


Can we override constructors in java?

681


What is difference between length and length() method in java ?

564