Kotlin - Basics and JVM RuntimeWhich of the following is the correct way to start a Kotlin program?Afunction main() { console.log("Hello") }Bpublic static void main(String[] args) { System.out.println("Hello"); }Cdef main(): print("Hello")Dfun main() { println("Hello") }Check Answer
Step-by-Step SolutionSolution:Step 1: Recognize Kotlin syntaxKotlin uses 'fun' keyword to declare functions and 'main' is the entry point.Step 2: Identify other languages' syntaxfunction main() { console.log("Hello") } is JavaScript, C is Python, D is Java syntax.Final Answer:fun main() { println("Hello") } -> Option DQuick Check:Kotlin main function syntax = fun main() [OK]Quick Trick: Kotlin functions start with 'fun' keyword [OK]Common Mistakes:MISTAKESConfusing Kotlin with Java or Python syntaxUsing 'function' instead of 'fun'
Master "Basics and JVM Runtime" in Kotlin9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kotlin Quizzes Collections Fundamentals - Why immutable collections are default - Quiz 13medium Functions - Infix functions for readable calls - Quiz 12easy Functions - Function declaration syntax - Quiz 12easy Kotlin Basics and JVM Runtime - Comments and documentation syntax - Quiz 11easy Loops and Ranges - For loop with index (withIndex) - Quiz 6medium Loops and Ranges - Why ranges simplify iteration - Quiz 1easy Null Safety - Safe call operator (?.) - Quiz 5medium Null Safety - Let function with safe calls - Quiz 4medium Operators and Expressions - Range operator (..) and in operator - Quiz 14medium Operators and Expressions - Why operators are functions in Kotlin - Quiz 2easy