Loading...
QUIZ

Certification Test

 
Que No. 1 ) In Kotlin, what is the purpose of the when expression?

A.) To create loops
B.) To define switch statements
C.) To perform pattern matching and conditional execution
D.) To declare functions


Que No. 2 ) What is the Kotlin standard library?

A.) A library for creating graphical user interfaces
B.) A library for working with databases
C.) A collection of functions and classes that are part of the Kotlin language distribution
D.) A library for networking and communication


Que No. 3 ) In Kotlin, how do you define a class and its constructor in a single line?

A.) class MyClass() {}
B.) class MyClass {}
C.) class MyClass constructor() {}
D.) class MyClass constructor {}


Que No. 4 ) What is a data class in Kotlin?

A.) A class that contains only data fields and no methods
B.) A class used for working with dates and times
C.) A class that inherits from another class
D.) A class used for database operations


Que No. 5 ) What is the purpose of the init block in Kotlin?

A.) To define a class
B.) To perform initialization code for an instance
C.) To declare a variable
D.) To define an interface


Que No. 6 ) In Kotlin, which keyword is used to declare inheritance from another class?

A.) extends
B.) inherits
C.) : (colon)
D.) from


Que No. 7 ) How do you define a nullable variable in Kotlin?

A.) val myVar: String
B.) val myVar: String?
C.) var myVar: String
D.) var myVar: String?


Que No. 8 ) What is the Kotlin is operator used for?

A.) Arithmetic operations
B.) Type checking and type casting
C.) String manipulation
D.) Loop control


Que No. 9 ) In Kotlin, what is the Elvis operator (?:) used for?

A.) Performing arithmetic operations
B.) Checking for null values
C.) String interpolation
D.) Defining classes


Que No. 10 ) What is the purpose of the apply function in Kotlin?

A.) To create an instance of a class
B.) To perform a series of operations on an object and return it
C.) To define a function
D.) To check for null values