Can a private class be inherited?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Works at the International Criminal Court, Lives in The Hague, Netherlands.
A subclass does not inherit the private members of its parent class. However, if the superclass has public or protected methods for accessing its private fields, these can also be used by the subclass.
2023-06-11 06:42:35
评论(499)
Helpful(122)
Helpful
Helpful(2)

Ava Roberts
QuesHub.com delivers expert answers and knowledge to you.
A subclass does not inherit the private members of its parent class. However, if the superclass has public or protected methods for accessing its private fields, these can also be used by the subclass.