it shows no output in the console in kotlin

已回答

0

In Kotlin script a function must be invoked. A function in it self does not get executed. It's a declaration like a variable. So, change to 

 

fun main() { 
    println("Hello, World!")
}

main()
3
Avatar
Permanently deleted user

thank you very much... that was very useful...

can you tell how can i create a kotlin i.e., name.kt in intelliJ IDEA 2020.3 it is very confusing

0

Just create Kotlin class: 

0
Avatar
Permanently deleted user

and how to run it??

0

remove "class newprogram{}"

Entry point in Kotlin (fun main) should be outside of any class. 

0
Avatar
Permanently deleted user

Thank you so much....

0

请先登录再写评论。