import java.util.*;
public class set1 {
public static void main(String[] args) {
Set s = new HashSet();
s.add("car");
s.add("scooter");
s.add("bike");
s.add("aeroplane");
s.add("car");
Iterator it = s.iterator();
while (it.hasNext()) {
System.out.println(it.next());
}
}
}
Output
car bike aeroplane scooterIf you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.