tree.first and tree.last example.
Example
      import java.io.*;
import java.util.List;
import java.util.Arrays;// to use arrays 
import java.util.*;// Arrays.sort
public class Test_This {
	public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
		Process p1 = new Process();
		p1.method_1(); 	
	}
}
class Process 
{
String first[] = {"Java","A+","C#","XML","JSP","PHP","Z", "C#"};
//to be used with set add all change other wise
String[] second = {"0.0","0.1","0.2","0.3","0.2","0.4"};

public Process()
{
System.out.println("Default) constructor");
}
public void method_1()
{
TreeSet tree = new TreeSet();
//for( int i = 0; i < 5; i++)
for(String s1 : second)
{
	tree.add(s1);
}
System.out.println(tree);
System.out.println("first element " +tree.first());
System.out.println("last element " + tree.last());
Iterator it = tree.iterator();
do
{
	System.out.println(it.next() );
	
}while(it.hasNext());
}
}