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
How do you clear an arraylist in java?
What is the difference between the jdk 1.02 event model and the event-delegation model introduced with jdk 1.1?
How do you define a singleton class?
How list contains works in java?
What all methods are used to prevent thread execution ?
What Is Query Throttling in java?
What are memory tables?
What is the purpose of the system class in java programming?
How do you sort a set in java?
What is the memory leak in java?
What does sprintf return?
String class is defined under which package in java?
What is boolean false?
What is meant by vector class, dictionary class, hash table class, and property class?
Convert a BST into a DLL and DLL to BST in place.