标签:scala
package ch2 /** * Created by Bo on 2015/1/12. */ object Test extends App{ val list = List(1,2,3) val list2 = 0 :: list // This is an operator (or method)of class List ::,所有以:结尾的操作符都是右结合的 } /* def ::[B >: A] (x: B): List[B] = new scala.collection.immutable.::(x, this) :: 是一个class, 代表一个非空的List */
本文出自 “大数之为用” 博客,谢绝转载!
Scala bite by bite ---- 详解 :: 操作符
标签:scala
原文地址:http://dingbo.blog.51cto.com/8808323/1602631