can be inherited, but after the subclass inherits it, it cannot be directly referenced and accessed. It is the private part of the father and can only be open to members of the parent class.
Generally, there are methods such as public interface get and set in the parent class, which can be accessed through this method. No direct access.
(Online learning video tutorial sharing: java video tutorial)
As shown below:
Related article tutorials Recommended: java introductory tutorial
The above is the detailed content of Can private methods in java be inherited?. For more information, please follow other related articles on the PHP Chinese website!