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 / phani raju

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

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an example of a keyword?

1001


What is the old name of java?

913


How does a for loop work java?

982


What is difference between null and void?

909


How to handle a web browser resize operation?

1002


What classes of exceptions may be caught by a catch clause in java programming?

1111


What are access specifiers available in java?

966


How can you write a loop indefinitely in java programming?

947


What are examples of modifiers?

1007


Can we catch more than one exception in a single catch block?

1015


What causes memory leaks in java?

864


What are recursive functions? Give some examples?

1116


What is the difference between hashmap and hashtable? What is an interface?

1068


What is the indent key?

988


What loop means?

902