Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
val numbers = [1, 2, 3]
val numbers = arrayOf(1, 2, 3)
val numbers: Array = [1, 2, 3]
val numbers: Array = arrayOf(1, 2, 3)
Char
String
Int
Float
var name: String = null
var name: String? = null
var name: Nullable = null
var name: NullableString = null
Long
Double
What is the output of the following Kotlin code?
fun main() {val name: String? = nullprintln(name?.length)}
null
0
Compilation error
Runtime error
fun main() {val name = "John"println("Hello, $name!")}
Hello, $name!
Hello, John!
Hello, {name}!
Hello, {John}!
const val name = "John"
var name = "John"
val name = "John"
final val name = "John"
val names: ArrayList = ["John", "Jane"]
val names = ["John", "Jane"]
val names: List = listOf("John", "Jane")
val names = arrayListOf("John", "Jane")
var 1name = "John"
var name = 1
var name: String = "John"
255
32767
2147483647
9.22337203685477e18