Vidyalelo
Computer Science · all questions

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

292

Questions

5/15

Page

Pick an option on a question to see the right answer and solution.

In Kotlin, which collection type has an order and can contain duplicate elements?

Select an option to see the answer and solution.

Which collection type ensures element uniqueness in Kotlin?

Select an option to see the answer and solution.

What is the purpose of the init block in Kotlin?

Select an option to see the answer and solution.

What does the mapOf() function do in Kotlin?

Select an option to see the answer and solution.

Which of the following is not a valid way to create an object in Kotlin?

Select an option to see the answer and solution.

What is the purpose of the "constructor" in Kotlin?

Select an option to see the answer and solution.

What is the keyword used to define a singleton class in Kotlin?

Select an option to see the answer and solution.

What is the difference between a property and a field in Kotlin?

Select an option to see the answer and solution.

What is the purpose of the "override" keyword in Kotlin?

Select an option to see the answer and solution.

What is the difference between a "companion object" and a regular object in Kotlin?

Select an option to see the answer and solution.

What is the keyword used to define an interface in Kotlin?

Select an option to see the answer and solution.

What is the syntax for creating a subclass in Kotlin?

Select an option to see the answer and solution.

How do you define a property in Kotlin that can only be accessed within the same class?

Select an option to see the answer and solution.

What is the keyword used to define a sealed class in Kotlin?

Select an option to see the answer and solution.

What is the keyword used to define an extension function in Kotlin?

Select an option to see the answer and solution.

What is the keyword used to define a type alias in Kotlin?

Select an option to see the answer and solution.

What is the difference between a "var" and a "val" in Kotlin?

Select an option to see the answer and solution.

What is the keyword used to define a companion object in Kotlin?

Select an option to see the answer and solution.

What is the purpose of the "object" keyword in Kotlin?

Select an option to see the answer and solution.

What is the keyword used to define a constructor in Kotlin?

Select an option to see the answer and solution.