今天学习了Infix type的知识,来看看实战代码:
def main(args:Array[String]){
object log { def >>:(data:String):log.type = {println(data);log}}
"Hadoop" >>: "spark" >>: log
val list = List()
val newList = "A" :: "B" :: list
println(newList)
class Infix_Type[A,B]
val infix:Int Infix_Type String = null
case class Cons(first:String,second:String)
val case_class = Cons("one","two")
case_class match {case "one" Cons "two" => println("Spark!!!")}
}
}
分享下更多的scala资源吧:
百度云盘:http://pan.baidu.com/s/1gd7133t
微云云盘:http://share.weiyun.com/047efd6cc76d6c0cb21605cfaa88c416
360云盘: http://yunpan.cn/cQN9gvcKXe26M (提取码:13cd)
信息来源于 DT大数据梦工厂微信公众账号:DT_Spark
关注微信账号,获取更多关于scala学习内容