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 one third plus one third as a fraction?

868


What is the difference between jfc & wfc?

1012


Why super is first line in java?

997


What is file in java?

982


Explain about automatic type conversion in java?

1004


How many types of parsers are there?

959


What do you understand by synchronization?

985


What is the purpose of static methods and variables?

987


Who found java?

938


What is the main use of generics in java?

918


Difference between final and effectively final ?

1024


Can you access the private method from outside the class?

906


Can we declare a class as abstract without having any abstract method?

948


Can a class have 2 constructors?

848


I want to persist data of objects for later use. What’s the best approach to do so?

873