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...

there are some duplicate values in ArrayList, how U'll get
that array with out duplicate?

Answer Posted / sai



ArrayList list = new ArrayList();
list.add("a");
list.add("b");
list.add("a");
list.add("c");
list.add("b");
HashSet set = new HashSet(list);
list.clear();
list.addAll(set);
System.out.println("ArrayList : ");
for (Object data : list) {
System.out.println(data);

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of using the java bean?

998


What is OOP Language?

1019


What modifiers may be used with a top-level class?

999


What are benefits of java?

1003


What is java util collection?

998


Explain creating threads by extending thread class ?

1008


Can we declare main () method as non static?

916


What is java util function?

994


What is multithreading in java?

1002


What is a singleton puppy?

919


Explain the scope or life time of class variables or static variables?

926


Can you explain the meaning of aggregation and composition

939


Explain about core java?

1057


What is the use of callablestatement?

961


What are bind parameters?

981