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 integer size in java?

962


Explain how to convert any java object into byte array.

939


Why do we need variables?

939


How to declare an arraylist in java?

1023


What is a numeric digit?

1046


Is arraylist dynamic in java?

945


What is runtime polymorphism or dynamic method dispatch?

987


What is object-oriented paradigm?

1024


Should you use singleton pattern?

909


Explain the significance of listiterator.

1042


Why main() method is public, static and void in java ?

1049


What is cr keyboard?

1163


What is the tradeoff between using an unordered array versus an ordered array?

1181


Can a constructor call another constructor?

940


How do you add an element to an arraylist in java?

899