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 |
What is a linkedhashmap java?
What are inbuilt functions in java?
What is instance synchronization?
Explain differences between collection api and stream api?
What is non static block in java
10 Answers Emphasis, Ness Technologies,
What does this mean java?
What does it mean to be immutable?
Why can we not override static method?
What is method and methodology?
What are different types of references?
Why is singleton class used?
What is a generic data type?