Notice
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 게임
- 핑크
- php
- 맛집
- 아이러브니키
- 일상
- 아이폰
- 시사회
- 레고
- great forest
- goblin sword
- jQuery
- 강추
- JavaScript
- 유료
- 아이폰게임
- Monument
- 감상
- 영화
- 모뉴먼트
- 잡담
- 아이패드
- 공략
- 추천
- Pink
- 카이로소프트
- 모뉴먼트 밸리
- 후기
- Monument Valley
- 가사
Archives
- Today
- Total
잡담소장소
[JAVA] Collections Reverse Sort 시 컴파일에러 본문
일반적으로 1차원 리스트보다는 object 리스트(Collection)를 많이 쓰는데 Collection을 reverse 정렬할 때 컴파일에러가 나서 구글링해보니 딱 내가 겪은 케이스가 stackoverflow에 올라와있었다. :)
이 부분은 lambda의 weakness으로 comparing까지는 Comparator<[CLASS]>클래스가 지정되어 있는데 이후 reversed()가 호출될때는 Comparator<T>로 호출되어 제대로 동작하지 않은 것이라고 한다 :)
https://stackoverflow.com/questions/25172595/comparator-reversed-does-not-compile-using-lambda
Comparator.reversed() does not compile using lambda
I have a list with some User objects and i'm trying to sort the list, but only works using method reference, with lambda expression the compiler gives an error: List userList = Arrays....
stackoverflow.com
반응형
'Study ;3' 카테고리의 다른 글
[PHP] LDAP에서 받은 thumbnailphoto 속성값을 img 태그에 넣기 (0) | 2020.01.23 |
---|---|
[CSS] <table>의 일부 컬럼 가로 스크롤링 기능 (0) | 2019.12.20 |
[Javascript] a href를 통해 다운로드 시 beforeunload 이벤트 이슈 (0) | 2019.09.27 |
[Angular2] Component in Another Component (0) | 2019.08.01 |
[jQuery] bootstrap table sort 문제 (0) | 2018.02.19 |
Comments