Kotlin MCQ For Freshers & Experienced

  • Question 1) Kotlin is developed by?
  • Question 2) Which of the following is used to handle null exceptions in Kotlin?
  • Question 3) What is the default behavior of Kotlin classes?
  • Question 4) Which of the following is true for Kotlin variables?
  • Question 5) What is an immutable variable?
  • Question 6) Identify the correct way to create an arraylist in Kotlin?
  • Question 7) Which of follwing targets currently not supported by Kotlin?
  • Question 8) Which of the following open source license is Kotlin released under?
  • Question 9) Does Kotlin work only for Java?
  • Question 10) Is Kotlin backward-compatible?
  • Question 11) Does Kotlin allow macros?
  • Question 12) How do you get the length of a string in Kotlin?
  • Question 13) How to make a multi lined comment in Kotlin?
  • Sharad Jaiswal
  • 05th Mar, 2020
  • 605 Followers

Kotlin MCQ
Updated ON

05th Mar, 2020

No. of Questions

14

Posted In

MCQ

Author

Sharad Jaiswal

Q1. Kotlin is developed by?

  • Adobe
  • Google
  • JetBrains
  • Microsoft
View Answer
Kotlin is developed by JetBrains.

Q2. Which of the following is used to handle null exceptions in Kotlin?

  • Elvis Operator
  • Range
  • Sealed Class
  • Lambda function
View Answer
Elvis Operator is used to handle null exceptions in Kotlin.

Q3. What is the default behavior of Kotlin classes?

  • All classes are sealed
  • All classes are public
  • All classes are abstract
  • None of these
View Answer
All classes are final is the default behavior of Kotlin classes.

Q4. Which of the following is true for Kotlin variables?

  • var can't be changed
  • val corresponds to final variable in Java
  • val can be changed
  • All variables are immutable by default
View Answer
val corresponds to final variable in Java is true for Kotlin variables.

Q5. What is an immutable variable?

  • A variable that can't change, read-only
  • A variable that can be changed
  • A variable used for string interpolation
  • None of the above
View Answer
Immutable variable are a variable that can't change, it is read-only.

Q6. Identify the correct way to create an arraylist in Kotlin?

  • val list = arrayListOf(1, 2, 3)
  • val map = hashMapOf(1 to "one", 2 to "two", 3 to "three")
  • val set = hashSetOf(1, 2, 3)
  • enum class Color {RED, GREEN, BLUE}
View Answer
val list = arrayListOf(1, 2, 3) is correct way to create an arraylist in Kotlin.

Q7. Which of follwing targets currently not supported by Kotlin?

  • .NET CLR
  • LLVM
  • Javascript
  • None of the above
View Answer
.NET CLR isn't supported by Kotlin.

Q8. Which of the following open source license is Kotlin released under?

  • FreeBSD License (BSD-2-Clause)
  • MIT License (MIT)
  • Apache License 2.0 (Apache 2.0)
  • GNU General Public License (GPL)
View Answer
Apache License 2.0 (Apache 2.0) is Kotlin released under.

Q9. Does Kotlin work only for Java?

  • Yes
  • No
View Answer
No, Kotlin doesn't work only for Java.

Q10. Is Kotlin backward-compatible?

  • Yes
  • No
View Answer
Yes, kotlin is backward-compatible.

Q11. Does Kotlin allow macros?

  • Yes
  • No
View Answer
No, kotlin doesn't allow macros.

Q12. How do you get the length of a string in Kotlin?

  • str.lengthOf
  • str.length
  • str.lengthOf
  • None of these
View Answer
str.length is used to get the length of a string in Kotlin.

Q13. How to make a multi lined comment in Kotlin?

  • / multi line comment /
  • //
  • /* */
  • None of these
View Answer
/ multi line comment / is used to make a multi lined comment in Kotlin.

Q14. Which file extension is used to save Kotlin files.

  • .kot
  • .java
  • .andriod
  • .kt or .kts
View Answer
.kt or .kts extension is used to save Kotlin files.

About Author :

  • Author of Kotlin MCQ

    Sharad Jaiswal

    Sharad Jaiswal is Sr. Web Developer from Noida area. He have rich experience in PHP, Angular Js, React, javascript and Node .If you any query or project on these programming you can drop your enquiry in comment section.

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.