How to access a method that it declared as protected?
Answer Posted / ranganathkini
If a method is marked protected, only the subclass of that
class can access it. To make it accessible to other classes,
the subclass of that class can override the protected method
and the override can be marked as public making it
accessible to other classes.
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the purpose of the main method?
How do you check if a string contains only numeric digits?
Differentiate between the constructors and methods in java?
What is the formula to calculate percentage?
What's the purpose of using break in each case of switch statement?
How do you remove duplicates from an array in java?
Which list does not allow duplicates in java?
Explain the polymorphism principle?
What one should take care of, while serializing the object?
Can a boolean be null java?
What does replaceall do in java?
Tell me about your ability to work under pressure
What is port number in java?
What is the difference between @before and @beforeclass annotation?
Can an arraylist be empty?