- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
java access modifiers with method overriding
Yes, an overridden method can have a different access modifier but it cannot lower the access scope.
The following rules for inherited methods are enforced -
- Methods declared public in a superclass also must be public in all subclasses.
- Methods declared protected in a superclass must either be protected or public in subclasses; they cannot be private.
- Methods declared private are not inherited at all, so there is no rule for them.
- Related Articles
- method overriding with access modifiers in Java
- What are access modifiers and non-access modifiers in Java?
- Access Modifiers in Java
- Access and Non Access Modifiers in Java
- Non Access Modifiers in Java
- What are the differences between access modifiers and non-access modifiers in Java?
- Types of access modifiers in Java?
- Exception handling with method overriding in Java.
- Method overriding in Java
- Access Modifiers in C++
- Access Modifiers in C#
- How many non-access modifiers are there in Java?
- Rules for Java method overriding
- What are private, public, default and protected access Java modifiers?
- What are final, abstract, synchronized non-access modifiers in Java?

Advertisements