Kotlin MCQs with answers Page - 5

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 'val x = 5 / 2' evaluate to in Kotlin?

  • (A) 2.5
  • (B) 2
  • (C) 2.0
  • (D) 5

A

Admin • 828.03K Points
Coach

Q. Which keyword is used to define constants in Kotlin?

  • (A) const
  • (B) final
  • (C) static
  • (D) constant

A

Admin • 828.03K Points
Coach

Q. How do you define a read-only property in Kotlin?

  • (A) val propertyName
  • (B) var propertyName
  • (C) readonly propertyName
  • (D) immutable propertyName

A

Admin • 828.03K Points
Coach

Q. Which function in Kotlin is used to transform a collection?

  • (A) transform()
  • (B) convert()
  • (C) map()
  • (D) update()

A

Admin • 828.03K Points
Coach

Q. What is the default return type of a Kotlin function if none is specified?

  • (A) Int
  • (B) Any
  • (C) Unit
  • (D) void

A

Admin • 828.03K Points
Coach

Q. Which keyword is used to create a coroutine in Kotlin?

  • (A) launch
  • (B) start
  • (C) begin
  • (D) run

A

Admin • 828.03K Points
Coach

Q. Which Kotlin scope function returns the result of the last expression?

  • (A) apply
  • (B) also
  • (C) let
  • (D) run

A

Admin • 828.03K Points
Coach

Q. What does the 'by lazy' delegate do in Kotlin?

  • (A) Initializes a value immediately
  • (B) Initializes a value when accessed for the first time
  • (C) Prevents initialization
  • (D) Initializes in a loop

A

Admin • 828.03K Points
Coach

Q. Which keyword is used to delegate behavior in Kotlin?

  • (A) delegate
  • (B) by
  • (C) with
  • (D) to

A

Admin • 828.03K Points
Coach

Q. What is the main benefit of using Kotlin over Java?

  • (A) No compilation required
  • (B) Better syntax for C++
  • (C) Null safety and conciseness
  • (D) Slower execution

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