Which keyword prevents a method from being overridden in a subclass?
Correct answer
D. final
14 views
D. final
14 views
A final method cannot be overridden, and a final class cannot be extended. An abstract method is the opposite, since it must be overridden. transient and volatile apply only to fields.
Asked in: NTS, PPSC, FPSC, OCA Java
Not sure why the answer is D? Ask here and get an explanation.