- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSample6.java
More file actions
Latest commit
21 lines (19 loc) · 527 Bytes
/
Copy pathSample6.java
File metadata and controls
21 lines (19 loc) · 527 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
importjava.util.Iterator;
importjava.util.LinkedHashSet;
publicclassSample6 {
publicstaticvoidmain(String[] args)
{
LinkedHashSetls=newLinkedHashSet(); // follow order concept of index as well as wont follow duplicate elements
ls.add(100);
ls.add("true");
ls.add(true);
ls.add(100);
ls.add(1);
Iteratoritr=ls.iterator();
while(itr.hasNext())
{
Objecto= itr.next();
System.out.println(o);
}
}
}