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 sortedset in java?
What do you understand by an io stream?
What is the purpose of using the java bean?
How do you convert an int to a string in java?
How do you identify independent and dependent variables?
What are the kinds of polymorphism?
How do weakhashmap works?
Is java still necessary?
Explain the private protected method modifier?
what is use of functional interface in java 8?
What are predicates in java 8?
How finally used under exception handling?
How do you get length in java?
What does g mean in regex?
what do you understand by the term string with respect to java?