일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 국세청 해외주식 양도세 신고방식
- 주식 양도세 신고방법
- 홈택스 해외주식 양도세
- java.sql.SQLSyntaxErrorException
- 테스트 자동화
- 피보나치함수 예제
- tomcat log
- 피보나치함수
- Katalon Recorder 사용법
- oracle group by
- recursion example
- 재귀함수 예제
- 최대공약수 예제
- 재귀 예제
- 한국투자증권 양도세 신고
- js 자동완성
- git 연동
- katalon
- 해외주식 양도세 신고
- katalon 비교
- katalon xpath
- 톰캣 실시간 로그
- katalon 자동화
- katalon 사용법
- 피보나치 예제
- javascript 자동완성
- bfs 미로탐색 java
- 한국투자증권 해외주식 양도세
- CSTS 폭포수 모델
- 해외증권 양도세 한국투자증권
- Today
- Total
엄지월드
java8 lambda stream 시작하기 본문
1. 배열에 데이터 입력 후 추출
List <String> ids = Arrays.asList("1", "2", "3"); // 보통 모델이 많이 들어간다.
ids.stream().forEach(System.out::println); // 출력문
2. 데이터형 변경
List <String> ids2 = Array.asList("1", "2", "3");
// map 은 원하는 데이터형으로 변경해준다. collect를 이용해서 데이터를 다시 포장한다.
List <Long> ids3 = ids2.stream().map(Long::parseLong).collect(Collectors.toList());
ids3.stream().forEach(System.out::println); // 출력문
3. 데이터에서 특정 문자 추가하기
List <String> ids6 = Array.asList(1, 2, 3, 4);
List <String> ids7 = ids6.stream().map( i -> i+" : ").collect(Collectors.toList());
ids7.stream().forEach(System.out.println); // 출력문
4. 짝수 데이터만 뽑기
List <Integer> ids4 = Array.asList(1, 2, 3, 4);
// filter를 이용해서 특정 데이터를 가져온다
List <Integer> ids5 = ids4.stream().filter( n -> n%2 == 0).collect(Collectors.toList());
ids5.stream().forEach(System.out::println); // 출력문
'java' 카테고리의 다른 글
eclipse module import 및 export 방법 (0) | 2022.09.30 |
---|---|
메서드(Method) 함수(Function) 차이 (0) | 2021.03.14 |
[Excel POI] 시간만 저장하기 (2) | 2017.09.16 |
[Excel POI] 예제 모음 (0) | 2017.08.24 |
[Excel POI] 자바 엑셀 다운로드 POI 예제(Maven 미사용) (0) | 2017.05.05 |