Java - sort() 클래스를 sorted해보기!

parkkhee·2023년 2월 28일
0

옹숭깊다

목록 보기
11/18
...
List<Device> devices = new ArrayList<>();
...
...
Collections.sort(devices, new Comparator<Device>() {
            @Override
            public int compare(Device o1, Device o2) {
                return o1.id-o2.id;
            }
});
...
...
profile
순우리말 백엔드 개발자

0개의 댓글