View Single Post
  #2 (permalink)  
Old August 7th, 2006, 08:30 PM
panacea panacea is offline
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Bhavesh, what you describe is the default access modifier (when you don't specify public, private, or protected). Protected acts as public within the class and its subclasses, but is hidden outside of those two cases. I'd say the disadvantage to protected is that people can subclass your class and create public getters/setters for it, therefore removing the intention of the access modifier.

Jon Emerson
http://www.jonemerson.net/
Reply With Quote