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 difference between checked and unchecked exception in java?
What is boolean query?
How do you replace all in word?
Can an integer be null java?
In which language java is written?
What are the 6 boolean operators?
How do you reverse sort a list in java?
What is the difference between logical data independence and physical data independence?
What is 16 bits called?
Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?
What is the purpose of the finalize() method?
Can we overload run() method in java?