What is the output of the following code?
val list : List<Int> = listof(1, 2, 3)
list.add(4)
print(list)
val list : List<Int> = listof(1, 2, 3)
list.add(4)
print(list)A. It does not compile, as listof is not known
B. [5, 6, 7]
C. It does not compile as List has no add method
D. [1, 2, 3, 4]
Answer: Option C
Related Questions on Kotlin Program
A. A new version of Java.
B. A JavaScript framework.
C. A statically-typed programming language for the JVM, Android, and browser.
D. A database management system.
Which platform does Kotlin primarily target?
A. Python Bytecode
B. JavaScript
C. JVM (Java Virtual Machine) Bytecode
D. PHP

Join The Discussion