QuesHub > 方法 > 子类 > 重写 > ASK DETAIL

Can you override a protected method?

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

Isabella Patel

Studied at the University of Manchester, Lives in Manchester, UK.
Protected can be accessed only by subclasses in other packages. Classes in the same package can also access protected fields, methods and constructors as well, even if they are not a subclass of the protected member's class. Override : An instance method in a subclass with the same signature.
2023-05-08 12:30:28

Amelia Lewis

QuesHub.com delivers expert answers and knowledge to you.
Protected can be accessed only by subclasses in other packages. Classes in the same package can also access protected fields, methods and constructors as well, even if they are not a subclass of the protected member's class. Override : An instance method in a subclass with the same signature.
ask:3,asku:1,askr:137,askz:21,askd:152,RedisW:0askR:3,askD:0 mz:hit,askU:0,askT:0askA:4