- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample7.java
More file actions
Latest commit
22 lines (21 loc) · 543 Bytes
/
Copy pathsample7.java
File metadata and controls
22 lines (21 loc) · 543 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
importjava.util.Iterator;
importjava.util.TreeSet;
publicclasssample7 {
publicstaticvoidmain(String[] args)
{
TreeSetts=newTreeSet<>();//accept homogeneous objects dont allow duplicates and provide ascending order
ts.add(100);
ts.add(3);
ts.add(400);
ts.add(150);
ts.add(0);
ts.add(120);
ts.add(200);
Iteratoritr=ts.iterator();
while(itr.hasNext())
{
Objecto=itr.next();
System.out.println(o);
}
}
}