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
what is the difference between Object Based Language and Object Oriented Language?
How do you check if a string contains only numeric digits?
What is the difference between JVM and JRE?
List some features of the abstract class.
What is class variable java?
What is tostring () method?
What is the common usage of serialization? What exceptions occur during serialization?
What is the difference between class & structure?
why would you use a synchronized block vs. Synchronized method? : Java thread
What is the base class of all exception classes in java?
Q1.A. Write note on “The class path Environment Variable”? B. Which are different kinds of source code? Q2.A. How to create an interface? B. Why convert an applet to an application? Q3.A. How to use Media tracker Class. B. How to use string tokenizer class. Q4 A. Explain the overview of UDP messaging. B. Difference between SQL Exception class and SQL Warning class. Q5. A. How to create com object in Java? B. Write short notes on “The properties class” Q6. A. When object is created and destroyed? B. Explain the JDB in depth & command line. C. Write short notes on Web Sites.
Can we modify the throws clause of the superclass method while overriding it in the subclass?
What is function overriding and overloading in java?
What is used of static keyword in java?
What is the r character?