Kotlin MCQs with answers Page - 11

Here, you will find a collection of MCQ questions on Kotlin. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 828.03K Points
Coach

Q. What will be the result of `println(5 in 1..10)`?

  • (A) true
  • (B) false
  • (C) 5
  • (D) 1..10

A

Admin • 828.03K Points
Coach

Q. How do you represent a character in Kotlin?

  • (A) 'A'
  • (B) A
  • (C) "A"
  • (D) @A

A

Admin • 828.03K Points
Coach

Q. Which of the following is a correct Kotlin string template?

  • (A) Hello + name
  • (B) Hello {name}
  • (C) Hello $name
  • (D) Hello &name

A

Admin • 828.03K Points
Coach

Q. Which function is used to read input from the console in Kotlin?

  • (A) read()
  • (B) readInput()
  • (C) readLine()
  • (D) input()

A

Admin • 828.03K Points
Coach

Q. What is the correct way to declare an array in Kotlin?

  • (A) array[1, 2, 3]
  • (B) Array(1, 2, 3)
  • (C) arrayOf(1, 2, 3)
  • (D) list(1, 2, 3)

A

Admin • 828.03K Points
Coach

Q. What does the spread operator (*) do in Kotlin?

  • (A) Multiplies two values
  • (B) Spreads an array into individual arguments
  • (C) Expands a range
  • (D) Joins a string

A

Admin • 828.03K Points
Coach

Q. Which keyword is used to declare a loop in Kotlin?

  • (A) loop
  • (B) while
  • (C) iterate
  • (D) foreach

A

Admin • 828.03K Points
Coach

Q. Which Kotlin keyword creates a subclass?

  • (A) derive
  • (B) extends
  • (C) :
  • (D) inherits

A

Admin • 828.03K Points
Coach

Q. How do you define a function that returns nothing in Kotlin?

  • (A) fun myFunc(): void
  • (B) fun myFunc(): null
  • (C) fun myFunc(): Unit
  • (D) fun myFunc(): Nothing

A

Admin • 828.03K Points
Coach

Q. What is the default type of numbers without decimals in Kotlin?

  • (A) Double
  • (B) Float
  • (C) Int
  • (D) Long

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ