Vidyalelo
Computer Science · Q268

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications

Engineering and GATE · Computer Science · question 268

Q268

What does the following code print? val listA = mutableListOf(1, 2, 3) val listB = listA.add(4) print(listB)

A.
true
Answer
B.
[1, 2, 3, 4]
C.
Nothing, there is a compile error
D.
Unit

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board