import java.util.*; class Program4 { public static void main(String[] argv) { Vector tomb = new Vector(); tomb.add("eper"); tomb.add(25); tomb.add("malna"); tomb.add("barack"); tomb.addElement("korte"); System.out.println(tomb.get(1)); System.out.println(tomb.size()); System.out.println(tomb.remove(1)); System.out.println(tomb.size()); System.out.println(tomb.get(1)); System.out.println(tomb.elementAt(2)); System.out.println("Hol talalhato: " + tomb.indexOf("malna")); tomb.clear(); System.out.println(tomb.size()); tomb.addElement(new Integer(1)); tomb.addElement(new Integer(2)); System.out.println("Utolso: " + tomb.lastElement()); System.out.println("Elso: " + tomb.firstElement()); tomb.removeAllElements(); tomb.addElement("Valami"); tomb.addElement("Masik"); //Konverziók: Object[] tomb2 = tomb.toArray(); String[] tomb3 = new String[10]; tomb3 = (String []) tomb.toArray(tomb3); //Itt gond, ha a vektor nem string típusú elemet tartalmaz //Olyankor Object típusba lehet konvertálni. Enumeration e = tomb.elements(); } }