How to access a method that it declared as protected?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ravikiran(aptech mumbai)
a protected method can be accessed with in the same packege
and subclasses outside of the package
| Is This Answer Correct ? | 2 Yes | 1 No |
How java is platform independent?
41 Answers College School Exams Tests, Infosys, TCS,
When will we use them?
Why are lists ordered in java?
Realized?
How does java pattern compile work?
How can constructor chaining be done by using the super keyword?
What is final class?
What initialize variables?
Why is string builder not thread safe?
Is delete, next, main, exit or null keyword in java?
What are Normalization Rules? Define Normalization?
Can we define private and protected modifiers for variables in interfaces?