코틀린은 JVM의 언어 중 아무튼 핫하다.
val customers = 10
println("There are $customers customers")
// There are 10 customers
println("There are ${customers + 1} customers")
// There are 11 customers
Type에 대한 값
- Integers : Byte, Short, Int, Long
- Unsigned Integers : UByte, UShort, UInt, ULong
- Floating-point number : Float, Double
val currentTemp: Float = 24.5f
, val price: Double = 19.99
- Boolean : Boolean
- val isEnabled: Boolean = true
- Characters : Char
- val separator: Char = ',’
- String : String
- val message: String = "Hello, world!”
Collections
콜렉션은 자바에서는 순서나 집합적인 저장공간이다.
- Lists : 순서가 있는 데이터 집합으로 데이터 중복 허용함.
- Sets: 순서를 유지하지 않는 데이터 집합으로 데이터의 중복을 허용하지 않음