Complete the code to declare the main function in Kotlin.
fun [1]() { println("Hello, Kotlin!") }
The main function in Kotlin must be named main to serve as the entry point of the program.
Complete the code to define a Kotlin source file path inside the standard project structure.
src/[1]/kotlin/com/example/app/Main.ktIn Kotlin projects, source files are usually placed under src/main/kotlin following the standard Gradle project structure.
Fix the error in the Gradle build script to apply the Kotlin plugin.
plugins {
id("[1]") version "1.8.0"
}The correct plugin id for Kotlin JVM projects is kotlin-jvm. This enables Kotlin support for JVM targets.
Fill both blanks to create a Kotlin data class with two properties.
data class User(val [1]: String, val [2]: Int)
The data class User has two properties: name of type String and age of type Int.
Fill all three blanks to create a Gradle dependency declaration for Kotlin standard library.
dependencies {
implementation("org.jetbrains.kotlin:[1]:[2]")
testImplementation("org.jetbrains.kotlin:kotlin-test:[3]")
}The Kotlin standard library dependency is kotlin-stdlib with version 1.8.0. The test dependency uses kotlin-test with the same version.