scala数组

一、数组相关操作
1、to 和 until 的区别与运用

0 to 10
res1: Range(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

0 until 10
res2:Range(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)

5 to 14 by 3
res3: Range(5, 8, 11, 14)

10 to 0 by -1
res4:Range(10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)

5 until 14 by 3 
res5:Range(5, 8, 11)

10 until 0 by -1
res6: Range(10, 9, 8, 7, 6, 5, 4, 3, 2, 1)

posted @ 2013-09-02 18:33  vincent_hv  阅读(441)  评论(0编辑  收藏  举报