加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Index of Array in Scala

(2016-01-31 23:47:21)
标签:

array

分类: scala学习
val test=Array((1,2),(7,8))
test: Array[(Int, Int)] = Array((1,2), (7,8))

val m=test(1)
m: (Int, Int) = (7,8)//the Index is from 0


val n=test(1)._1
n: Int = 7//the Index is from 1

so,
val p=test(0)._1
p: Int = 1

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有