网站介绍:文章浏览阅读5.7k次,点赞3次,收藏7次。近来学习scala,在继承这一块有一点小小的发现,遂记录下来,以备以后复习之用。1,当with放在子类定义的后面时,输出的结果为:300和150class Animal { val weight = 100 val doubleWeight = 2 * weight}class Tiger extends { override val weight: Int = 150} wit..._scala with和extends区别
- 链接地址:https://blog.csdn.net/qq_21188127/article/details/79303445
- 链接标题:scala 继承extends,with浅见_scala with和extends区别-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:1210
- 网站标签:scala with和extends区别