Join Now
Home Aptitude Reasoning DI VA GK CA CA Hindi Quiz Placements
var name: String = null
var name: String? = null
var name = null
var name: Nullable = null
What is the output of the following Kotlin code?
fun main() {val a = 5val b = 2val result = a.toDouble() / bprintln(result)}
2.5
2
2.5f
Char
String
Int
Boolean
fun main() {val name: String? = nullprintln(name?.length)}
null
0
Compilation error
Runtime error
255
32767
2147483647
9.22337203685477e18
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 name by lazy = "John"
var name = lazy { "John" }
lateinit var name: String = "John"
val name: String? = null
fun main() {val a = 5val b = 2val result = a / bprintln(result)}
var name: NullableString = null