Wednesday, April 18, 2007
Can protected or friendly features be accessed from different packages?
Subscribe to:
Post Comments (Atom)
World of tricky Core Java Q&A(Java SE),Java EE and Open source technologies like Struts,Hibernate,Spring,Velocity etc
Disclaimer
Interview Questions On Java,Java EE Copyright © 2012
2 comments:
protected class can be accessed from outside of the package if the outside class extends this protected class, even if it is in different package.
You can access the protected properties of other classes in outside the package through the INHERITANCE. But default modifier CAN NOT. that is the major difference between protected & default.
Post a Comment