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
What is the purpose of using the java bean?
What is OOP Language?
What modifiers may be used with a top-level class?
What are benefits of java?
What is java util collection?
Explain creating threads by extending thread class ?
Can we declare main () method as non static?
What is java util function?
What is multithreading in java?
What is a singleton puppy?
Explain the scope or life time of class variables or static variables?
Can you explain the meaning of aggregation and composition
Explain about core java?
What is the use of callablestatement?
What are bind parameters?