Kotlin MCQs with answers Page - 7

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

Q. Which of the following is a Kotlin visibility modifier?

  • (A) open
  • (B) internal
  • (C) readonly
  • (D) package

A

Admin • 833K Points
Coach

Q. Which Kotlin class is used for representing a pair of values?

  • (A) Tuple
  • (B) Pair
  • (C) List
  • (D) Map.Entry

A

Admin • 833K Points
Coach

Q. Which of the following functions will return the number of characters in a string?

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

A

Admin • 833K Points
Coach

Q. What does the keyword 'tailrec' indicate in Kotlin?

  • (A) Function returns a list
  • (B) Function has a default return type
  • (C) Function is tail-recursive
  • (D) Function throws an exception

A

Admin • 833K Points
Coach

Q. How do you convert a Kotlin List to a MutableList?

  • (A) toMutableList()
  • (B) makeMutable()
  • (C) mutate()
  • (D) asMutable()

A

Admin • 833K Points
Coach

Q. Which of the following is NOT a scope function in Kotlin?

  • (A) with
  • (B) let
  • (C) run
  • (D) do

A

Admin • 833K Points
Coach

Q. What type of programming paradigm does Kotlin primarily follow?

  • (A) Functional
  • (B) Object-Oriented
  • (C) Procedural
  • (D) Object-Oriented and Functional

A

Admin • 833K Points
Coach

Q. Which function in Kotlin can be used to check if a list is empty?

  • (A) isNull()
  • (B) hasNoElements()
  • (C) isEmpty()
  • (D) checkEmpty()

A

Admin • 833K Points
Coach

Q. What is the supertype of all Kotlin classes?

  • (A) Any
  • (B) Object
  • (C) Base
  • (D) Super

A

Admin • 833K Points
Coach

Q. Which method is used to sort a list in Kotlin?

  • (A) arrange()
  • (B) orderBy()
  • (C) sort()
  • (D) organize()

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