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

Explain the key functions of data binding?

0 Answers   Akamai Technologies, Aspire, Impetus, Infogain, Tavant Technologies, Virtusa,


Is java developer a good career?

0 Answers  


Explain try and catch keywords in java?

0 Answers  


Default layout of panel and frame?

3 Answers  


Can string be considered as a keyword?

0 Answers  






What are singleton services?

0 Answers  


What is the function of static in java?

0 Answers  


Why arraylist is not synchronized in java example?

0 Answers  


Integer.parse Int(bf.readLine(System.out.println("enter value for n["+m+"]:"))); can it run under this

1 Answers  


Discuss 2D arrays.

0 Answers   Amdocs,


How do you compare two strings lexicographically?

0 Answers  


What is array initialization in java?

0 Answers  


Categories