I have a Arraylist object, it has duplecate values also. Now
question is i want delete duplecate data in that objet with
out using Set?
Answer Posted / john
ArrayList al = new ArrayList();
al.add("A");
al.add("B");
al.add("A");
al.add("C');
for(int i = 0; i<al.size(); i++)
System.out.println(": " + al.get(i));
if(al.contains("A"))
al.remove("A");
for(int i = 0; i<al.size(); i++)
System.out.println("- " + al.get(i));
Is This Answer Correct ? | 7 Yes | 10 No |
Post New Answer View All Answers
Difference between Linked list and Queue?
Is cout buffered?
What is the basic of java?
Which software is used for java programming?
How do you break a loop?
What does ide stand for?
How to sort list of list in java?
What is size_t?
What is an example of procedure?
Can we override the private methods?
what are Hostile Applets?
What is illegal identifier in java?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
What is jit and its use?
Write a java program to print fibonacci series?