Kotlin MCQ

Kotlin MCQ | Freshers & Experienced

  • Sharad Jaiswal
  • 12th Feb, 2021

We have listed here the best Kotlin MCQ Questions for your basic knowledge of Kotlin. This Kotlin MCQ Test contains 15 multiple Choice Questions. You have to select the right answer to every question.

Kotlin MCQ Question & Answers

1) Kotlin is developed by?

  • A. Adobe
  • B.Google
  • C.JetBrains
  • D.Microsoft

2) Which of the following is used to handle null exceptions in Kotlin?

  • A. Elvis Operator
  • B.Range
  • C.Sealed Class
  • D.Lambda function

3) What is the default behavior of Kotlin classes?

  • A. All classes are sealed
  • B.All classes are public
  • C.All classes are abstract
  • D.All classes are final

4) Which of the following is true for Kotlin variables?

  • A. var can't be changed
  • B.val corresponds to final variable in Java
  • C.val can be changed
  • D.All variables are immutable by default

5) What is an immutable variable?

  • A. A variable that can't change, read-only
  • B.A variable that can be changed
  • C.A variable used for string interpolation
  • D.None of the above

6) Identify the correct way to create an arraylist in Kotlin?

  • A. val list = arrayListOf(1, 2, 3)
  • B.val map = hashMapOf(1 to "one", 2 to "two", 3 to "three")
  • C.val set = hashSetOf(1, 2, 3)
  • D.enum class Color {RED, GREEN, BLUE}

7) Which of follwing targets currently not supported by Kotlin?

  • A. .NET CLR
  • B.LLVM
  • C.Javascript
  • D.None of the above

8) Which of the following open source license is Kotlin released under?

  • A. FreeBSD License (BSD-2-Clause)
  • B.MIT License (MIT)
  • C.Apache License 2.0 (Apache 2.0)
  • D.GNU General Public License (GPL)

9) Does Kotlin work only for Java?

  • A. Yes
  • B.No

10) Is Kotlin backward-compatible?

  • A. Yes
  • B.No

11) Does Kotlin allow macros?

  • A. Yes
  • B.No

12) How do you get the length of a string in Kotlin?

  • A. str.lengthOf
  • B.str.length
  • C.str.lengthOf
  • D.None of these

13) How to make a multi lined comment in Kotlin?

  • A. / multi line comment /
  • B.//
  • C./* */
  • D.None of these

14) Which file extension is used to save Kotlin files.

  • A. .kot
  • B..java
  • C..andriod
  • D..kt or .kts

15) Kotlin was developed under the which license?

  • A. Apache 1.0
  • B.Apache 1.1
  • C.Apache 2.0
  • D.None of the above

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Feb
React JS MCQ
01st
Feb
Angular Js MCQ
01st
Feb
Angular 2 MCQ
01st
Feb
JSON MCQ
01st
Feb
PHP MCQ