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 an example of a keyword?
What is the old name of java?
How does a for loop work java?
What is difference between null and void?
How to handle a web browser resize operation?
What classes of exceptions may be caught by a catch clause in java programming?
What are access specifiers available in java?
How can you write a loop indefinitely in java programming?
What are examples of modifiers?
Can we catch more than one exception in a single catch block?
What causes memory leaks in java?
What are recursive functions? Give some examples?
What is the difference between hashmap and hashtable? What is an interface?
What is the indent key?
What loop means?