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 parseint?

1025


What is the difference between preemptive scheduling and time slicing?

1070


Can extern variables be initialized?

957


Is void a keyword in java?

1023


Can we override data members in java?

1146


What is the default execution method in java?

1205


Explain all java features with real time examples

1724


What is the difference between import java.util.date and java .util?

1058


What is thread start?

965


What is the difference between a constructor and a method?

1261


What is palindrome in java?

999


What does indexof mean?

1031


What is abstract class? Explain

1051


What is diamond operator in java?

967


I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?

1016