0% found this document useful (0 votes)
5 views3 pages

Kotlin Cia 3 QB

The document is a question bank for a module on Kotlin for cross-platform application development, covering various topics such as collections, event handling, exception handling, and Android application structure. It includes both theoretical questions and practical coding tasks, aimed at assessing understanding and application of Kotlin concepts. The document is divided into two parts, with Part A focusing on foundational knowledge and Part B on practical implementation and examples.

Uploaded by

sasmitamayilsamy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Kotlin Cia 3 QB

The document is a question bank for a module on Kotlin for cross-platform application development, covering various topics such as collections, event handling, exception handling, and Android application structure. It includes both theoretical questions and practical coding tasks, aimed at assessing understanding and application of Kotlin concepts. The document is divided into two parts, with Part A focusing on foundational knowledge and Part B on practical implementation and examples.

Uploaded by

sasmitamayilsamy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

DEPARTMENT : INFORMATION TECHNOLOGY

MODULE 3 QUESTION BANK

22IT008 – KOTLIN FOR CROSS PLATFORM APPLICATION DEVELOPMENT

PART A

1. Comprehend the difference between Set and Map in Kotlin with an example.

2. Classify the three ways of event handling in Android.

3. Predict the output:


fun main() {
val numbers = arrayListOf(10, 20, 30)
numbers.remove(40)
println(numbers)
}
Will this program throw an error or execute successfully? Explain.
4. A student is trying to install Android Studio but encounters a configuration error. Show the steps
he/she should take to troubleshoot it.
5. Predict the output
fun main(args: Array<String>) {
val array = intArrayOf(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
for(index in array.indices - 5) {
println(array[index])
}
}
6. List the steps used to create ListView in Kotlin.

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.

11. Illustrate how to create an ArrayList in Kotlin? Provide an example.

12. Recall the purpose of HashSet in Kotlin.

13. Predict the output for the following code:


fun main(args : Array<String>){
var num = 10 / 0
println(num)
}
14. Give the basic structure of a "Hello World" Android application.

15. Comprehend about event handling in Android with an example.

16. Write the steps used to create ListView in Kotlin.

17. Differentiate try-catch and try-finally in Kotlin exception handling.

18. List the read only methods available in Kotlin collection.

PART B

1. Describe the following methods with an example.


● mutableListOf()
● mapOf()
● hashSetOf()
● listOf()

2. Illustrate with necessary examples, Android TextView in Kotlin

3. Comprehend the steps to connect to MySQL Database from Kotlin using JDBC.

4. Demonstrate on how to create an Android button and the different ways to


perform events on Button using Kotlin with an example.
5. Distinguish between the Kotlin unchecked exception and checked exception with
necessary examples.
6. Take a nested list and return a single flattened list with all values except nil/null. Build
kotlin code using functions to accept an arbitrarily-deep nested list-like structure and
return a flattened structure without any nil/null values.
Sample Input:
[1,[2,3,null,4],[null],5]
Sample Output:

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy