Kotlin MCQ Test: Kotlin MCQs - Practice Questions
1. How does Kotlin handle default arguments in functions?
2. What is the purpose of the 'sealed class' in Kotlin?
3. What is the purpose of the 'groupBy' function in Kotlin?
4. How do you declare an extension property in Kotlin?
5. What is the purpose of the 'let' extension function in Kotlin?
6. How do you declare an interface in Kotlin?
7. In Kotlin, what is the purpose of the 'also' function?
8. In Kotlin, what is the purpose of the 'let' extension function?
9. How do you declare a nullable variable in Kotlin?
10. What is the syntax for a single-line comment in Kotlin?
11. How do you define an extension function in Kotlin?
12. How does Kotlin handle primary constructors in a class?
13. What is the purpose of the 'tailrec' modifier in Kotlin?
14. Which keyword is used for type casting in Kotlin?
15. What is the purpose of the 'trim' function in Kotlin?
16. What is the purpose of 'lateinit' in Kotlin?
17. In Kotlin, what is the purpose of the 'reified' keyword?
18. What is the purpose of the 'sealed' modifier in Kotlin?
19. What is the purpose of the 'reduce' function in Kotlin?
20. What is the purpose of the 'forEach' function in Kotlin?
21. What is the purpose of the 'crossinline' modifier in Kotlin?
22. How do you declare a package in Kotlin?
23. What is the purpose of the 'reified' keyword in Kotlin?
24. How does Kotlin handle extension properties?
25. How do you declare a generic class in Kotlin?
26. How do you declare an enum class in Kotlin?
27. In Kotlin, what is the 'operator overloading' feature used for?
28. How does Kotlin handle null safety?
29. What is the purpose of the 'by' keyword in Kotlin?
30. What is the purpose of the 'by lazy' keyword in Kotlin?
31. What is the purpose of the 'invoke' function in Kotlin?
32. How do you define a class with a private constructor in Kotlin?
33. What is the purpose of the 'expect' keyword in Kotlin?
34. Which keyword is used to define a constant in Kotlin?
35. What is the purpose of the 'apply' function in Kotlin?
36. What is the purpose of the 'with' function in Kotlin?
37. In Kotlin, what is the purpose of the 'yield' function?
38. What is the purpose of the 'noinline' modifier in Kotlin?
39. How do you define a function in Kotlin?
40. What is the purpose of the 'flatMap' function in Kotlin?
41. In Kotlin, what is the purpose of the 'noinline' modifier for functions?
42. How do you declare a generic function in Kotlin?
43. In Kotlin, what is the 'invoke' operator used for?
44. How do you declare a function with an infix notation in Kotlin?
45. In Kotlin, how do you create a class with a primary constructor?
46. What is the syntax for a multiline string in Kotlin?
47. What is the purpose of the 'coroutine' keyword in Kotlin?
48. What is the purpose of the 'first' function in Kotlin?
49. In Kotlin, what is the 'getter' keyword used for?
50. What is the purpose of the 'break' statement in Kotlin?