![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
scala
萧博士
程序猿,博士猴,工程狮
交流建议直接邮件:phil.xiao@aliyun.com
展开
-
Scala之隐式参数与隐式转换
abstract class Monoid[A] { def add(x: A, y: A): A def unit: A}原创 2018-05-28 17:06:47 · 1609 阅读 · 0 评论 -
Scala之泛型及约束实战
1. 类型变量界定scala中泛型使用中括弧[]来指定泛型的类型参数,如下所示:class Stack[A] { private var elements: List[A] = Nil def push(x: A) { elements = x :: elements } def peek: A = elements.head def pop(): A = { val cu...原创 2018-05-28 17:23:18 · 253 阅读 · 1 评论