I got the question in an interview, can final method override....?
I said YES. Interviewer has got strange gesture. What is wrong with it? Grammatically it is correct answer, I guess. final methods can override, but final method cannot be overridden.
Was my answer correct?
I found some people are interested to reopen this question.
If his English was bad, then you should've tried to clarify what he means. Communication is a very important aspect of building software.
Apart from that:
final (Java)
In the Java programming language, the final keyword is used in several different contexts to define an entity which cannot later be changed.
A final method cannot be overridden by subclasses. This is used to prevent unexpected behavior from a subclass altering a method that may be crucial to the function or consistency of the class.
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