Kotlin MCQ Questions - Mobile Development

11. In Kotlin, ____________ is used when you know what functionalities a class should have.

A. exception class
B. inheritance class
C. abstraction class
D. None of the above

View Answer


12. What is the syntax for declaring a variable as volatile in Kotlin?

A. var x: Long? = null
B. Volatile var x: Long?
C. Volatile var x
D. Volatile var x: Long? = null

View Answer


13. Which of th following is used to compare two strings in Kotlin?

A. Using == operator
B. Using compareTo() extension function
C. Both A and B
D. None of the above

View Answer


14. Elvis Operator is used for handling null expectations in Kotlin.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


15. ____________ helps to iterate through a range.

A. And operator
B. Ranges operator
C. Or operator
D. Conditional operator

View Answer


16. Which file extension is used to save Kotlin files?

A. .java
B. .kot
C. .kt
D. .kotlin

View Answer


17. All classes in Kotlin classes are by default?

A. public
B. sealed
C. abstract
D. final

View Answer


18. Can we migrate code from Java to Kotlin?

A. Yes
B. No
C. Can be yes or no
D. Can not say

View Answer


19. What is an immutable variable?

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

View Answer


20. Does Kotlin support primitive Datatypes?

A. Yes
B. No
C. Can be yes or no
D. Can not say

View Answer





Discussion


* You must be logged in to add comment.