-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[switch week2] junghyun-eunjung #6
base: main
Are you sure you want to change the base?
Conversation
|
||
- Kotlin 이란? | ||
|
||
- (Java 동생..ㅎ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋㅋㅋ cute.
- 함수형 프로그래밍 | ||
|
||
- Java 에서 아래와 같이 Stream 을 썼다면, | ||
|
||
```java | ||
List<Person> personList = new ArrayList<>(); | ||
|
||
List<PersonResponse> result = personList.stream() | ||
.filter(person -> Objects.nonNull(person.getSeq()) && Objects.nonNull(person.getName())) | ||
.map(person -> new PersonResponse(person.getName(), person.getSeq())) | ||
.toList(); | ||
``` | ||
|
||
- Kotlin 에서는 아래와 같이 사용할 수 있다. | ||
|
||
```kotlin | ||
val personList: List<Person> = listOf() | ||
|
||
val result: List<PersonResponse> = personList | ||
.filter { person -> person.seq != null && person.name != null } | ||
.map { person -> PersonResponse(person.name!!, person.seq!!) } | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
신기한 자바의 스트림..
- 파일 레벨에서 간단하게 함수 선언 가능. | ||
- Java 의 static method 를 대체할 수 있다. | ||
|
||
### 문제 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
week2
우아한 테크 코스
문제 하나를 선택해서 풀어보고, 각자 pr 을 작성한 뒤 리뷰를 진행할 예정입니다.