```val list= listOf<Int>(5,3,2,4,2) println(...
# announcements
a
Copy code
val list= listOf<Int>(5,3,2,4,2)
println(list)
clear(list)
println(list)
e
listOf creates immutable list You may use mutableListOf instead of listOf
Copy code
val list = mutableListOf<Int>(5,3,2,4,2)
k
And I think it's
list.clear()
a
I tried
Showed error
k
Did you make it a mutable list?
a
No
Oh, I understood that thanks
😛 1
😄 1