package lt.bit.student; import java.util.Arrays; public class Vykdymas { public static void main(String[] args) { Studentas[] studentai=new Studentas[4]; studentai[0]=new Studentas("Jonas",8); studentai[1]=new Studentas("Petras",6); studentai[2]=new Studentas("Antanas",9); studentai[3]=new Studentas("Kazys",10); // Arrays.sort(studentai, (o1, o2)-> o2.getPazimys()-o1.getPazimys()); Arrays.sort(studentai); for (Studentas s:studentai) { System.out.println(s); } } }