abstract class Base {
protected val _value: String
def value: String = _value
}
class Test extends Base {
protected val _value = "Hello"
}
val test = new Test()
println(test.value)
This works perfectly fine but I still have questions:
The override keyword is a safety feature that lets you be specific about your intentions. It prevents you from erroneously overriding an implementation of a base class / trait if you didn’t mean to and it prevents you from not overriding an implementation you wanted to (but used overloading instead).
If you implement an abstract class, you have to implement all missing implementations, so one could argue that the overrides keyword is kind of redundant in this case.
FWIW, I always override abstract members, as I believe that serves to share intention, it makes clear to the reader which methods where defined somewhere else and which ones right there.