Kotlin programs are made of functions and classes, typically starting with a main function as the entry point.
fun main() {
println("Hello, Kotlin!")
}Kotlin does not require semicolons at the end of statements, though they can be used.
val x = 10 // valid
val y = 20; // also valid but not neededKotlin supports both single-line and multi-line comments:
// This is a single-line comment
/* This is
a multi-line comment */Kotlin provides two functions for displaying output: print() and println().
print() outputs text without moving to a new line.println() outputs text and then appends a newline character, moving the cursor to the next line AFTER.Example:
Kotlin uses braces {} for code blocks, and indentation is recommended for clarity, though not syntactically required.
Ask the AI if you need help understanding or want to dive deeper in any topic