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 should I import for arraylist in java?
How do you classify Dialog Box?
Explain the term virtual machine?
Is java call by value?
What is a singleton class in Java?
How is hashset defined in java?
Is singleton a bad practice?
Is it possible to write a regular expression to check if string is a number?
How do you format in java?
What do you mean by access modifier?
How do you convert boolean to boolean?
Explain the hierarchy of java exception classes?
What is replaceall in java?
1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?
what state does a thread enter when it terminates its processing? : Java thread