Java tutorial
import java.util.Collections; import java.util.Vector; public class MainClass { public static void main(String args[]) { Vector v1 = new Vector(); v1.add("A"); v1.add("C"); v1.add("B"); Vector v2 = (Vector) v1.clone(); Collections.sort(v2); System.out.println(v1); System.out.println(v2); } }