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 a singleton in genetics?
Are arrays classes in java?
What is difference between iterator access and index access?
What is role of void keyword in declaring functions?
How do I compare two strings in word in java?
What is off heap memory?
What is unicode used for?
Is java call by value?
What is the char data type?
Explain java coding standards for methods?
What is the difference between length and length () in java?
Does apple use java?
Why does abstract class have constructor?
What is boolean example?
What is meant by inheritance and what are its advantages?