package massiivid; public class RistkylikuProov { public static int pindaladeSumma(Ristkylik[] m){ int summa=0; for(Ristkylik r:m){ summa+=r.pindala(); } return summa; } public static void main(String[] args) { Ristkylik r1=new Ristkylik(4, 5); double b=2; Ristkylik r2=new Ristkylik(3, 7); Ristkylik r3=new Ristkylik(1, 3, 5, 6); System.out.println(r3.pindala()); System.out.println(pindaladeSumma( new Ristkylik[]{r1, r2, r3} )); } }