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 parseint?
What is the difference between preemptive scheduling and time slicing?
Can extern variables be initialized?
Is void a keyword in java?
Can we override data members in java?
What is the default execution method in java?
Explain all java features with real time examples
What is the difference between import java.util.date and java .util?
What is thread start?
What is the difference between a constructor and a method?
What is palindrome in java?
What does indexof mean?
What is abstract class? Explain
What is diamond operator in java?
I want to re-reach and use an object once it has been garbage collected. Define how it’s possible?