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 do you mean by ternary operator in java?

1033


What is mnemonic in assembly language?

1082


Explain garbage collection in java?

990


What is thread pool? How can we create thread pool in java?

1081


What is a ?

1208


What are the classes of java?

980


Explain the difference between an Interface and an Abstract class?

1188


What are encapsulation, inheritance and polymorphism?

1028


What is the difference between compiler and jvm?

1061


What is meant by inheritance and what are its advantages?

1112


Why null value is used in string?

1055


What is java and why do we need it? Explain

1151


What are pass by reference and pass by value?

997


What are the four pillars of java?

1217


Give us the name of the list layoutmanagers in java?

932