Kotlin Hello World
www.igiftidea.com
here is an example of a Kotlin program that prints "Hello, World!" to the console:
fun main() { println("Hello, World!") }
In this program, we define a function called main
, which is the entry point for the program. The println
function is used to print the string "Hello, World!" to the console.
To run this program, you can create a new Kotlin file in a text editor or an integrated development environment (IDE) such as IntelliJ IDEA or Android Studio. Then, copy the code above into the file and save it with a .kt
file extension (e.g., HelloWorld.kt
). Finally, you can run the program using the Kotlin compiler or by running the file directly from your IDE.