Home > Java > Javagetting Started > body text

Can private methods in java be inherited?

王林
Release: 2020-01-15 16:38:24
Original
4571 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!