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 / sushila
if super class method is public, then override method should
be public.
override method will take same access specifier or expanded one.
the order of access specifier is
private > default > protected > public
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the use of default method in interface in java? Explain
How many java versions are there?
What is a boolean used for?
Highest level event class of the event-delegation model?
What is oop in java?
How hashset works internally in java?
Can we extend singleton class in java?
What is hashing principle in java?
What does the “final” keyword mean in front of a variable? A method? A class?
What happens when you add a double value to a string?
What is literal example?
How does split work in java?
What is a loop java?
Is 0 an even number?
How can we create a synchronized collection from given collection?