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 udp in java?

1041


Is linkedlist thread safe in java?

1034


What is the final keyword in java?

1518


Name component subclasses that support painting in java programming?

1119


What do you mean by of string::valueof expression in java 8?

1004


Can we define static methods inside interface?

1029


What is the difference between overriding and overloading in OOPS.

1201


Is it possible to use string in the switch case?

1101


What do you mean by Hash Map and Hash Table?

1142


Can you inherit from an abstract class java?

1047


Why are getters and setters used?

1101


What is the purpose class.forname method?

1009


Write a program to print the pattern given below

990


What is the use of conditional statement?

1032


What are the basics of core java?

1060