Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
A type of function that can be suspended and resumed later.
A type of loop that runs in the background.
A type of class that is used for creating objects.
A type of variable that can be shared between threads.
A class is a blueprint for creating objects, while an object is a singleton instance of a class.
A class is a singleton instance of an object, while an object is a blueprint for creating classes.
There is no difference between a class and an object in Kotlin.
A class and an object are both used to create instances of a class.
val is immutable while var is mutable.
var is immutable while val is mutable.
Both val and var are immutable.
Both val and var are mutable.
A type of operator used for bitwise operations.
A type of operator used for arithmetic operations.
A type of operator used for null safety.
A type of operator used for logical operations.
Mobile app development
Web development
Database management
Machine learning
What is the output of the following code?
fun main() { val numbers = mutableListOf(1, 2, 3, 4, 5) numbers.removeIf { it % 2 == 0 } println(numbers)}
[1, 2, 3, 4, 5]
[1, 3, 5]
[2, 4]
This code will not compile.
fun main() { val numbers = listOf(1, 2, 3, 4, 5) val filteredNumbers = numbers.filter { it % 2 == 0 } println(filteredNumbers)}
The answer is + answer
The answer is $answer
The answer is {answer}
The answer is [answer]
fun main() { val x = 5 val y = 10 val result = if (x > y) "x is greater than y" else "y is greater than x" println(result)}
A. x is greater than y
y is greater than x
5
fun main() { val nullableString: String? = null val length = nullableString?.length ?: -1 println(length)}
0
-1
null
This