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

Join The Discussion