1 _=
setters:以_=接在getter的identifier后,并紧跟参数
def y_= (newValue: Int): Unit = { if (newValue < bound) _y = newValue else printWarning }
posted on 2017-09-24 09:09 satyrs 阅读(236) 评论(0) 编辑 收藏 举报