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 are daemon Threads in java?
What is difference between path and classpath variables?
What does sizeof return?
What is the difference between menuitem and checkboxmenu item?
Does google use java?
Explain java coding standards for interfaces?
Differentiate between the constructors and methods in java?
What is append function?
How do you differentiate abstract class from interface?
Can we have multiple public classes in a java source file?
How does queue work in java?
Why arraylist is used in java?
why using interface interface ?
How many bytes is double?
What is string length in java?