+ 1

Final methods

Can anyone please explain the statement -"Final methods can't be overridden"

2nd Jan 2018, 1:26 PM
Shalini Jha
Shalini Jha - avatar
1 Resposta
+ 16
we use final keyword before method name,instance variables & even before a class , by using final keyword we want that no modification must be made in it. Programmer declares a method as final in a class to prevent any subclass to override it. This is done by the Programmer when he would like to fix the behaviour of a method (else, it can be changed by subclass by overriding) //2nd para from google
2nd Jan 2018, 1:46 PM
Gaurav Agrawal
Gaurav Agrawal - avatar