import java.util.*; public class Andmed2{ public static void main(String[] argumendid){ List andmed=new ArrayList(); andmed.add("Madis"); andmed.add("Juku"); andmed.add("Mati"); andmed.add("Madis"); System.out.println(andmed); System.out.println("Kokku "+andmed.size()+ ", kohal 0 "+andmed.get(0)); andmed.add(1, "Kati"); System.out.println(andmed); System.out.println("Mati kohal "+andmed.indexOf("Mati")); System.out.println("Mari kohal "+andmed.indexOf("Mari")); andmed.remove(0); andmed.remove("Mati"); System.out.println(andmed); Collections.sort(andmed); System.out.println(andmed); for(String s: andmed){ System.out.println(s); } } }