What does the following code print?
val listA = mutableListOf(1, 2, 3)
val listB = listA.add(4)
print(listB)
val listA = mutableListOf(1, 2, 3)
val listB = listA.add(4)
print(listB)A. true
B. [1, 2, 3, 4]
C. Nothing, there is a compile error
D. Unit
Answer: Option A

Join The Discussion