QuesHub > 方法 > 能在 > 重写 > ASK DETAIL

Why final method Cannot be overridden in Java?

Noah Wilson | 2023-05-05 12:30:28 | page views:1749
I'll answer
Earn 20 gold coins for an accepted answer.20 Earn 20 gold coins for an accepted answer.
40more

Amelia Lewis

Studied at the University of Toronto, Lives in Toronto, Canada.
A final method in a superclass cannot be overridden in a subclass--this guarantees that the final method implementation will be used by all direct and indirect subclasses in the hierarchy. Methods that are declared private are implicitly final , because it's not possible to override them in a subclass.
2023-05-06 12:30:28

Lucas Lee

QuesHub.com delivers expert answers and knowledge to you.
A final method in a superclass cannot be overridden in a subclass--this guarantees that the final method implementation will be used by all direct and indirect subclasses in the hierarchy. Methods that are declared private are implicitly final , because it's not possible to override them in a subclass.
ask:3,asku:1,askr:137,askz:21,askd:152,RedisW:0askR:3,askD:0 mz:hit,askU:0,askT:0askA:4