1 _=
setters:以_=接在getter的identifier后,并紧跟参数
def y_= (newValue: Int): Unit = { if (newValue < bound) _y = newValue else printWarning }
时间: 2024-10-14 15:43:40
1 _=
setters:以_=接在getter的identifier后,并紧跟参数
def y_= (newValue: Int): Unit = { if (newValue < bound) _y = newValue else printWarning }