Kotlin MCQs with answers Page - 3

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 • 802.91K Points
Coach

Q. Which extension is used for Kotlin source files?

  • (A) .kt
  • (B) .kotlin
  • (C) .kot
  • (D) .java

A

Admin • 802.91K Points
Coach

Q. Which of the following is true about Kotlin arrays?

  • (A) They are fixed-size and immutable
  • (B) They are dynamic and can grow
  • (C) They are fixed-size but mutable
  • (D) They are always null-safe

A

Admin • 802.91K Points
Coach

Q. Which keyword in Kotlin is used to inherit a class?

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

A

Admin • 802.91K Points
Coach

Q. What is the default visibility modifier in Kotlin?

  • (A) public
  • (B) private
  • (C) protected
  • (D) internal

A

Admin • 802.91K Points
Coach

Q. How do you create a singleton in Kotlin?

  • (A) Using the singleton keyword
  • (B) Using object declaration
  • (C) Using static keyword
  • (D) Using companion class

A

Admin • 802.91K Points
Coach

Q. Which collection is immutable in Kotlin?

  • (A) arrayListOf()
  • (B) mutableListOf()
  • (C) listOf()
  • (D) arrayOf()

A

Admin • 802.91K Points
Coach

Q. How do you check if a variable is of a specific type in Kotlin?

  • (A) is
  • (B) typeof
  • (C) instanceof
  • (D) check

A

Admin • 802.91K Points
Coach

Q. Which keyword is used for abstract classes in Kotlin?

  • (A) virtual
  • (B) abstract
  • (C) base
  • (D) interface

A

Admin • 802.91K Points
Coach

Q. What does the !! operator do in Kotlin?

  • (A) It checks for null
  • (B) It converts nullable to non-nullable forcibly
  • (C) It is a comment operator
  • (D) It throws a warning

A

Admin • 802.91K Points
Coach

Q. Which Kotlin feature helps avoid boilerplate code for data holding classes?

  • (A) object
  • (B) data class
  • (C) enum class
  • (D) sealed class

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