Notice
잡담소장소
[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
반응형
'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