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 different types of constants?
What is the method to expand and collapse nodes in a jtree?
Is it possible for a yielded thread to get chance for its execution again?
Explain OOPs concept.
How many ways can we create singleton class?
Why null value is used in string?
How do you declare a string variable?
When throws keyword is used?
What is the association?
Explain the difference between treeset and treemap in java?
Will minecraft java be discontinued?
What is the loop in java?
What is java thread dump, how can we get java thread dump of a program?
What is a type parameter in java?
What is autoboxing in java?