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 is a "pure virtual" member function?

1098


What is the method in java?

1101


What is static block?

1129


Why is boolean important?

1063


What is a map? What are the implementations of map?

1095


How many days will it take to learn java?

935


What is a string what operation can be performed out with the help of a string?

1050


Why a dead thread occurs?

976


Explain the difference between an object-oriented programming language and object-based programming language?

983


Why strings in java are called as immutable?

990


What is the use of volatile in java?

1059


Is finalize() similar to a destructor?

1022


what is a thread pool in java and why is it used?

1003


What is the purpose of final keyword and when to use it?

1004


What is string in java?

1012