일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Fluent-bit
- While
- g1gc
- SpringBoot Initializr
- 연산자
- datatype
- ansible
- 기초
- Class
- datastructure
- 자료형
- zgc
- IAC
- For
- If
- Spring Security
- Sprint Security
- quicksort
- redis
- programmers
- C++
- MergeSort
- jvm
- Algorithm
- Java
- JPA
- Kotlin
- JavaScript
- lambda
- UserDetails
Archives
- Today
- Total
목록Val (1)
뭐라도 끄적이는 BLOG
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/xV3Pa/btslUM1cEHC/GVhCwdOPsgoCSq8kh6tzy0/img.png)
변수 선언 방법 모든 프로그램은 데이터를 저장할 수 있어야 하며, 변수를 사용하여 데이터를 저장할 수 있다. Kotlin에서는 2가지 키워드를 사용하여 변수를 선언한 수 있다. val: 선언시에만 초기화가 가능하며 값을 변경할 수 없는 읽기전용 상수이다. var: 일반적인 변수 선언 방법으로 언제든 읽기 쓰기가 가능한 방법이다. 기본적으로 변수는 읽기 전용으로 선언하는 것이 좋다. val popcorn = 5// There are 5 boxes of popcorn val hotdog = 7// There are 7 hotdogs var customers = 10// There are 10 customers in the queue // Some customers leave the queue customer..
Kotlin
2023. 7. 1. 04:37