Kotlin MCQs with answers Page - 10

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 class in Kotlin represents no value?

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

A

Admin • 828.03K Points
Coach

Q. Which of these is a Kotlin escape sequence for a new line?

  • (A) \r
  • (B) \n
  • (C) \b
  • (D) \t

A

Admin • 828.03K Points
Coach

Q. What does `?.` represent in Kotlin?

  • (A) Non-null call
  • (B) Safe call operator
  • (C) Elvis operator
  • (D) Type cast

A

Admin • 828.03K Points
Coach

Q. What does `!!` mean in Kotlin?

  • (A) Safe call
  • (B) Nullable type
  • (C) Non-null assertion
  • (D) Logical NOT

A

Admin • 828.03K Points
Coach

Q. Which function gets the number of elements in a collection?

  • (A) count()
  • (B) length()
  • (C) size()
  • (D) quantity()

A

Admin • 828.03K Points
Coach

Q. How do you write a comment in Kotlin?

  • (A) # comment
  • (B) // comment
  • (C) -- comment
  • (D) <!-- comment -->

A

Admin • 828.03K Points
Coach

Q. What does `as?` do in Kotlin?

  • (A) Casts to a type unsafely
  • (B) Performs null-safe type casting
  • (C) Converts to string
  • (D) Concatenates strings

A

Admin • 828.03K Points
Coach

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

  • (A) stop
  • (B) exit
  • (C) break
  • (D) halt

A

Admin • 828.03K Points
Coach

Q. Which function is used to delay execution in coroutines?

  • (A) wait()
  • (B) pause()
  • (C) delay()
  • (D) sleep()

A

Admin • 828.03K Points
Coach

Q. Which of these is a correct way to create a set in Kotlin?

  • (A) createSet(1, 2, 3)
  • (B) setOf(1, 2, 3)
  • (C) Set(1, 2, 3)
  • (D) makeSet(1, 2, 3)

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