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 the access scope of protected access specifier?
What happens to a static var that is defined within a method of a class?
Can we assign integer value to char in java?
What are the advantages of user defined functions?
How do you use wildcards?
Is java same as core java?
How is Object Oriented Programming different from Procedure Oriented Programming?
Is hashset sorted in java?
Is ++ operator thread-safe in java?
What is a void method?
Difference between arraylist and vector.
How many bits is a double?
what is mutual exclusion? How can you take care of mutual exclusion using java threads? : Java thread
What are thread local variables?
Explain the difference between comparator and comparable in java?