In this article let’s discuss about Scala getters and setters. Let’s go through the following methods without any delay 🙂
private var _value = ..... def value = _value //getter def value_= (newVal:Int) = _value = newVal //setter
Hope the above methods works for you. Happy Learning and get back to us Anytime.
Realted Posts : Difference between scala array and list