Kotlin Cia 3 QB
Kotlin Cia 3 QB
PART A
1. Comprehend the difference between Set and Map in Kotlin with an example.
7. Write the various touch events generated by the system, when multiple pointers touch the
screen at the same time.
8. Construct a Kotlin program to handle an exception using try and catch.
9. A shopping cart application needs to store the list of purchased items dynamically. Identify
which Kotlin collection would be best suited for this? Write a simple code snippet to elucidate
your choice.
Page 1 of 3
10. Differentiate List, Set, and Map in Kotlin.
PART B
3. Comprehend the steps to connect to MySQL Database from Kotlin using JDBC.
Page 2 of 3
[1,2,3,4,5]
7. Develop a kotlin program to create a List aL1 of type String and perform the following
operations.
• Add “Infy”, “Zoho”,”CTS”, “TCS”, “Wipro” into the aL1 using listOf() method.
• Print the element at the index 3.
• Drop the element “Infy”
• Check whether “Google” is present in aL1
• Display the size of the list.
• Display the elements from “CTS” to “Wipro”.
Iterate the elements and Observe the result.
8. Describe the following methods with an example
• listOf()
• mutableListOf()
• mapOf()
• hashMapOf()
9. Explain about the following exception handling with an examples
• Arithmetic Exception
• Null Pointer Exception
• Security Exception
• Array Index Out of Bound Exception
10. Interpret on how to create an Android button and the different ways to perform events
on Button using Kotlin with an example.
Page 3 of 3