티스토리 뷰

공부

[Java] unique strings in List ==> HashSet

승가비 2019. 11. 13. 20:43
728x90
List result1 = new ArrayList(new HashSet(intList));

 

https://stackoverflow.com/questions/2235471/save-a-list-of-unique-strings-in-the-arraylist

 

Save a list of unique Strings in the ArrayList

I read data from a text file, so there may be: John Mary John Leeds I now need to get 3 unique elements in the ArrayList, because there are only 3 unique values in the file output (as above). I ...

stackoverflow.com

https://elfinlas.github.io/2018/02/11/JavaCollectionDuplicate/

 

Java에서 컬렉션의 중복을 제거하는 방법

너무 오랜만의 포스팅??간만에 작성을 하는 포스팅입니다.요새 너무 정신없이 바빠져서 포스팅을 할 기회가 없었습니다.계속 포스팅을 꾸준하게 해야 하지만…노오력을 해야 겠네요 ㅠ근황은 근화이고 포스팅은 해야겠죠? Java에서 컬렉션에서 중복 제거요새 Java 개발에 빠져서 허우적 중인데 개발을 하다 보면 데이터를 컬렉션에 담아서 처리하는 경우가 많습니다.그리고

elfinlas.github.io

 

728x90

'공부' 카테고리의 다른 글

[SQL] ORA-00979: GROUP BY 표현식이 아닙니다.  (0) 2019.11.13
[SMTP] install mail server  (0) 2019.11.13
[FTP] install in mac  (0) 2019.11.13
[Spring] iBatis & MyBatis values  (0) 2019.10.30
[Hadoop] install hadoop in MacOSX  (0) 2019.10.29
댓글