object Array_opt { def main(args: Array[String]) { // init an array val array = new Array[String](3) val arr = Array(1, 2, 3, 4) // traversal element // method 1 for (i <- 0 until arr.length) { print(arr(i)) } // method 2 for (ele <- arr) { println(ele) } // method 3 for (i
快学scala之数组操作
最新推荐文章于 2021-12-06 22:47:07 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)