Kotlin - Basics and JVM RuntimeWhich of the following is the correct syntax for a Kotlin main function without parameters?Amain fun() { println("Hello") }Bfun main() { println("Hello") }Cfun main(String[] args) { println("Hello") }Dfun main(args: String) { println("Hello") }Check Answer
Step-by-Step SolutionSolution:Step 1: Recall Kotlin main function syntaxThe correct syntax for main without parameters is fun main() { ... }.Step 2: Check each option's syntaxThe option 'main fun() { println("Hello") }' has incorrect keyword order. 'fun main(args: String) { println("Hello") }' uses wrong parameter type. 'fun main(String[] args) { println("Hello") }' uses invalid Java-style syntax. Only 'fun main() { println("Hello") }' matches correct Kotlin syntax.Final Answer:fun main() { println("Hello") } -> Option BQuick Check:Main syntax no params = fun main() [OK]Quick Trick: Main function syntax: fun main() { } [OK]Common Mistakes:MISTAKESUsing Java-style parameter syntaxPlacing keywords in wrong orderAdding incorrect parameter types
Master "Basics and JVM Runtime" in Kotlin9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kotlin Quizzes Collections Fundamentals - Array creation and usage - Quiz 14medium Collections Fundamentals - Why immutable collections are default - Quiz 14medium Data Types - Type conversion is always explicit - Quiz 8hard Functions - Unit return type - Quiz 14medium Loops and Ranges - Repeat function for simple repetition - Quiz 10hard Null Safety - Safe casts with as? - Quiz 8hard Null Safety - Nullable types with ? suffix - Quiz 9hard Operators and Expressions - Arithmetic operators - Quiz 5medium Operators and Expressions - Equality (== structural vs === referential) - Quiz 4medium Variables and Type System - Val for immutable references - Quiz 7medium