This commit is contained in:
wandoubaba 2024-08-11 14:40:59 +08:00
parent 0c2ba0586d
commit 3034f98949
5 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,7 @@
package io.kotlinstudy.tour
fun main() {
val name = "Mary"
val age = 20
println("$name is $age years old")
}

View File

@ -0,0 +1,18 @@
package io.kotlinstudy.types
fun main() {
var customers = 10
customers = 8
println("There are $customers customers")
customers = customers + 3
println("There are $customers customers")
customers += 7
println("There are $customers customers")
customers -= 3
println("There are $customers customers")
customers *= 2
println("There are $customers customers")
customers /= 3
println("There are $customers customers")
}

View File

@ -0,0 +1,16 @@
package io.kotlinstudy.types
fun main() {
val a: Int = 1000
println(a)
val b: String = "log message"
println(b)
val c: Double = 3.14
println(c)
val d: Long = 100_000_000_000_000
println(d)
val e: Boolean = false
println(e)
val f: Char = '\n'
println(f)
}

View File

@ -0,0 +1,7 @@
package io.kotlinstudy.types
fun main() {
val d: Int
// println(d)
}

View File

@ -0,0 +1,9 @@
package io.kotlinstudy.types
fun main() {
val d: Int
d = 3
val e: String = "hello"
println(d)
println(e)
}