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

1003


What do you mean by light weight and heavy weight components?

969


What is the difference between a loader and a compiler?

971


we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.

1985


If a class is declared without any access modifiers, where may the class be accessed in java programming?

1136


What is string builder in java?

950


What is protected access modifier?

953


What is %d in printf?

994


Can we have any code between try and catch blocks?

928


a thread is runnable, how does that work? : Java thread

926


What is a private class in java?

970


What is this keyword used for?

1065


Tell me about your ability to work under pressure

2145


how to convert Java project into Maven ?

1001


What are the important features of Java 8 release?

1025