Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what are the methods in object?

1205


What is method in research paper?

1209


What’s the difference between constructors and other methods?

1049


How are multiple inheritances done in Java?

1200


Can you tell me range of byte?

1056


Can a class have an interface?

1039


How to sort double array in java?

1037


what is difference between equals and ==?

1120


How many static init can you have?

1265


Is a method a procedure?

1103


Why do we need array in java?

1055


Why do we declare a class static?

1245


What is gc()?

1136


Why is stringbuffer thread safe?

1089


What does @override mean?

1281