Java tutorial
import java.util.Vector; public class MainClass { public static void main(String args[]) { Vector<String> v = new Vector<String>(); v.add("A"); v.add("B"); String firstElement = (String) v.firstElement(); String lastElement = (String) v.lastElement(); System.out.println(firstElement); System.out.println(lastElement); } }