first commit
This commit is contained in:
18
TestJavaCollection9b.java
Normal file
18
TestJavaCollection9b.java
Normal file
@@ -0,0 +1,18 @@
|
||||
//WAJ to demo Treeset
|
||||
import java.util.*;
|
||||
public class TestJavaCollection9b{
|
||||
public static void main(String args[]){
|
||||
TreeSet<String> set=new TreeSet<String>();
|
||||
set.add("Ravi");
|
||||
set.add("Vijay");
|
||||
set.add("");
|
||||
set.add(null);
|
||||
set.add("Ravi");
|
||||
set.add("Ajay");
|
||||
|
||||
Iterator<String> itr=set.iterator();
|
||||
while(itr.hasNext()){
|
||||
System.out.println(itr.next());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user