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 syntax and characteristics of a lambda expression?
How do you define a method?
Explain reverse a linked list recursive java solution?
What is parsing in grammar?
What is object cloning in Java?
Explain different ways of creating a thread?
What does file separator do in java?
What is difference between static class and singleton pattern?
Is there a jre for java 11?
How to create com object in Java?
What is treeset in java collection?
Name component subclasses that support painting in java programming?
What is a “stateless” protocol ?
Is void a type?
What is javac used for?