Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
{x, y -> x + y}
(x, y) => x + y
[x, y] -> x + y
(x, y) -> {x + y}
fun myFunction()
fun myFunction(): String
fun myFunction(): Int = 42
All of the above
What is Kotlin?
A programming language
A database management system
A web framework
A markup language
What is the output of the following code?
fun main() { val nullableString: String? = null val length = nullableString?.length ?: -1 println(length)}
0
-1
null
This
Mobile app development
Web development
Database management
Machine learning
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.
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
This code will not compile.
var
my-variable
123foo
MyClass
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.
Extension functions are a way to add new functionality to existing classes without having to modify their source code.
Extension functions can only be defined for classes that are part of the Kotlin standard library.
Extension functions are not supported in Kotlin.
Extension functions can only be defined for classes that are marked as "open".