When writing a class extending from another it is possible to overwrite your methods.
In doing so you are writing another implementation, the original implementation being discarded/overwritten.
However, there are cases that, due to the way the class has been implemented, it is necessary that the original implementation of the superscript method is executed.
The way to do it is to use super.nomeMetodoSobrescrito()
.
When it is an abstract method it is never necessary to do so.
In other cases it shall do so when the class documentation so indicates.
As far as Android SDK is concerned, at least in the use of the Activity class, an exception will be made if you do not.
If, in Android Studio, use Generate... -> Override Methods... the method call will be automatically placed when needed.
I edited the question to make it more objective, see if that’s it.
– user28595
Just lacked "what would be" this super method that some have and others do not, and yes when to leave it or not. ;)
– rbz
Add it, good thing you already have 2 responses and they update. :)
– user28595
The method
super
is used to execute the code of the "parent" method. Sometimes it is necessary to leave (see the code of activities). But when there is no mandatory code in the "parent" method, this line becomes unnecessary.– Valdeir Psr