Bird
0
0

Which of the following is the correct syntax to print "Hello Kotlin" on one line in Kotlin?

easy📝 Syntax Q3 of 15
Kotlin - Basics and JVM Runtime
Which of the following is the correct syntax to print "Hello Kotlin" on one line in Kotlin?
Aprint["Hello Kotlin"]
Bprint("Hello Kotlin")
Cprintln("Hello Kotlin")
Dprintln Hello Kotlin
Step-by-Step Solution
Solution:
  1. Step 1: Check syntax for print function

    The correct syntax uses parentheses and double quotes: print("Hello Kotlin").
  2. Step 2: Identify invalid syntax

    Options A and D use incorrect brackets or missing parentheses, which cause syntax errors.
  3. Final Answer:

    print("Hello Kotlin") -> Option B
  4. Quick Check:

    Correct print syntax = print("text") [OK]
Quick Trick: Use parentheses and quotes for print syntax [OK]
Common Mistakes:
MISTAKES
  • Using square brackets instead of parentheses
  • Missing parentheses
  • Omitting quotes around text

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes