![](/img/trans.png)
[英]I get an error when i try to run my first kotlin code in intellij idea community version 2021.2
[英]Why I am unable to run my old Kotlin program in new version of IntelliJ Idea?
使用 Kotlin 1.4 和 jdk 14,此代碼可在 IntelliJ 中運行
class DogClass(private val id: Int, private val color: String) {
fun bark() = println("$color dog $id barks")
}
class Cat(private val id: Int, private val color: String) {
fun meov() = println("$color cat $id says meow")
}
fun main() {
val dog1 = DogClass(4, "Black")
dog1.bark()
val cat1 = Cat(4, "White")
cat1.meov()
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.