Kotlin MCQs with answers Page - 12

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. Which keyword is used for conditional branching in Kotlin?

  • (A) switch
  • (B) select
  • (C) when
  • (D) case

A

Admin • 828.03K Points
Coach

Q. What is the correct syntax to define a nullable string?

  • (A) val name: String!
  • (B) val name: ?String
  • (C) val name: String?
  • (D) val name = String?

A

Admin • 828.03K Points
Coach

Q. How do you check for equality in Kotlin?

  • (A) equals
  • (B) ==
  • (C) ===
  • (D) isEqual()

A

Admin • 828.03K Points
Coach

Q. How do you compare references (memory address) in Kotlin?

  • (A) ===
  • (B) ==
  • (C) is
  • (D) !=

A

Admin • 828.03K Points
Coach

Q. Which function creates a mutable list in Kotlin?

  • (A) mutableList()
  • (B) listOfMutable()
  • (C) mutableListOf()
  • (D) listOf()

A

Admin • 828.03K Points
Coach

Q. What is the base type for Kotlin exception classes?

  • (A) Throwable
  • (B) Exception
  • (C) Error
  • (D) Crash

A

Admin • 828.03K Points
Coach

Q. Which Kotlin keyword marks a variable that must be initialized later?

  • (A) defer
  • (B) lateinit
  • (C) lazy
  • (D) future

A

Admin • 828.03K Points
Coach

Q. What is the return type of a Kotlin constructor?

  • (A) Unit
  • (B) Nothing
  • (C) Class
  • (D) None

A

Admin • 828.03K Points
Coach

Q. Which operator is used for string concatenation in Kotlin?

  • (A) +
  • (B) &
  • (C) concat
  • (D) ++

A

Admin • 828.03K Points
Coach

Q. Which keyword is used for inheritance in Kotlin?

  • (A) open
  • (B) extend
  • (C) class
  • (D) implements

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