Home  >  Article  >  Java  >  Can private methods in java be inherited?

Can private methods in java be inherited?

王林
王林Original
2020-01-15 16:38:244618browse

Can private methods in java be inherited?

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:

Can private methods in java be inherited?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn