List和Array类型有什么区别?
似乎可以对它们进行相同的操作(循环,过滤器表达式等),行为或用法是否存在差异?
val names1 = listOf("Joe","Ben","Thomas")
val names2 = arrayOf("Joe","Ben","Thomas")
for (name in names1)
println(name)
for (name in names2)
慕妹3146593
慕村9548890
扬帆大鱼
相关分类