For example in the following
class Base {
def test() {
def internal() {
println("base internal")
}
}
}
Is it possible for internal to be overwritten in a subclass?
No. Internal methods are effectively private.
To complete the answer of Daniel: if you want to be able to override the internal
method, you should declare it as protected
directly below the Base
class.
In fact, internal method can be seen as a block of the method itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With