Can we iterate through collection using for loop?
Answer Posted / haneef
Yes, We can
Set set=new HashSet();
set.add("one");
set.add("two");
for(Iterator it=set.iterator();it.hasNext();)
{
System.out.println(it.next());
}
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
what is abstract class in Java?
What does a method signature consist of?
Is java still necessary?
What is the difference between notify and notifyall method?
what is the difference between the methods sleep() and wait()? : Java thread
What is the different types of functions?
What are class members by default?
which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at priya_gupta@gmail.com
What is the difference between the paint() and repaint() methods in java programming?
Is sizeof a keyword in java programming?
What is == in java?
What is the collections api?
Are arrays dynamic in java?
What is character in data type?
How to use arraylist in java netbeans?