How to access a method that it declared as protected?

Answers were Sorted based on User's Feedback



How to access a method that it declared as protected?..

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

How to access a method that it declared as protected?..

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 to access a method that it declared as protected?..

Answer / bulbull

only thru inheritance

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is difference between checked and unchecked exception in java?

0 Answers  


What is boolean query?

0 Answers  


How do you replace all in word?

0 Answers  


Can an integer be null java?

0 Answers  


In which language java is written?

0 Answers  






What are the 6 boolean operators?

0 Answers  


How do you reverse sort a list in java?

0 Answers  


What is the difference between logical data independence and physical data independence?

0 Answers  


What is 16 bits called?

0 Answers  


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?

0 Answers  


What is the purpose of the finalize() method?

0 Answers  


Can we overload run() method in java?

0 Answers  


Categories