when asub class inherits a super class and overrides a
public method of super class in sub class(public method in
super class).
why these methods needs to be public in sub class.
(otherwise compile time error).
Answer Posted / imtiyaz
The access specifier for the overriding method can allow
more but not less access than the overridden method.
For example, a protected method in the superclass can be
made public but not private
private, protected and public is Ascending order of access
modifiers depending upon the strength
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
what is mena by object block any what is the use of that
Explain differences between checked and unchecked exceptions in java?
Why can't we use static class instead of singleton?
What is a lock or purpose of locks in java?
what is the constructor and how many types of constructors are used in java?
Is java code slower than native code?
What happens when a thread cannot acquire a lock on an object in java programming?
Define array. Tell me about 2-D array.
What are the features of junit?
What’s the difference between constructors and other methods?
What is meant by the value of a variable?
What is classpath?
Is array a class in java?
What is a parameter in matrices?
What are strings in physics?