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 ternary operator in java? What is an interface?
Explain the difference between static and dynamic binding in java?
What is files manifesting?
What are bind parameters?
What is Java Package and which package is imported by default?
What is mean by collections in java?
what is the use of datasource in core java?
How to sort a collection of custom Objects in Java?
What is final?
Why multiple inheritance is not supported by java?
How can we create an immutable class in java?
What are the major advantages of internal iteration over external iteration?