import java.util.Iterator; class Main{ public static void main(String[] args) throws AkvariumFullt{ Akvarium akvarium = new Akvarium(4); Fisk nemo = new Fisk("Nemo", 1); Fisk marlin = new Fisk("Marlin", 2); System.out.println(akvarium); akvarium.settInn(nemo); System.out.println(akvarium); akvarium.settInn(marlin); System.out.println(akvarium); akvarium.settInn(new Fisk("Dory", 3)); System.out.println(akvarium); for(Fisk fisk : akvarium){ System.out.println(fisk); } Iterator iterator = akvarium.iterator(); while(iterator.hasNext()){ Fisk fisk = iterator.next(); System.out.println(fisk); } } }