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
What is import java util arraylist?
How many types of assembly languages are there?
What is the arraylist in java?
What are the types of exceptions?
Can we have this () and super () together?
What is difference between static and abstract class?
What is the unit of plancks constant?
What is the use of static class?
Which number is denoted by leading 0x or 0x in java?
define polymorphism in java
What is the use of a copy constructor?
Is string is a data type in java?
can rmi and corba based applications interact ?
What is a parameter example?
What are the types of strings?