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

Can java object be locked down for exclusive use by a given thread?

993


How can constructor chaining be done by using the super keyword?

1091


What happens if we override only equals?

969


What are the steps that are followed when two computers connect through tcp?

988


Can we have static methods in an interface?

1046


What are the types of relation?

1041


How do I print a “?

995


What are the two types of java?

1166


What is the use of flag?

1079


what are different ways in which a thread can enter the waiting state? : Java thread

961


What is java volatile?

1041


Why we used break and continue statement in java?

1135


Explain about data types?

1078


What is java console application?

1002


What is the use of System class?

1157