일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Java
- Algorithm
- While
- redis
- Sprint Security
- JPA
- jvm
- datastructure
- 자료형
- ansible
- UserDetails
- 연산자
- JavaScript
- Class
- For
- 기초
- g1gc
- SpringBoot Initializr
- MergeSort
- Spring Security
- quicksort
- programmers
- zgc
- C++
- Fluent-bit
- IAC
- Kotlin
- lambda
- datatype
- If
Archives
- Today
- Total
목록when (1)
뭐라도 끄적이는 BLOG

Conditional expressions Kotlin은 조건식을 위해 if와 when을 제공한다. if와 when중 when을 사용하는 것을 더 추천한다. If you have to choose between if and when, we recommend using when as it leads to more robust and safer programs. - Kotlin공식 문서 if if를 사용하려면 괄호안에 조건식을 추가하고 중괄호 안에 결과가 참인 경우 수행할 작업을 추가한다. val d: Int val check = true if (check) { d = 1 } else { d = 2 } println(d) // 1 Kotlin에는 삼항 연사자(condition ? then : else)가 없..
Kotlin
2023. 7. 1. 05:53