File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Protected and Private

 
Conrad Kirby
Ranch Hand
Posts: 178
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between protected and private? Can you read the values of a protected class variable, but not write to it? Or am i completely off track.
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Conrad,
Protected: Can be seen (and used) by the class and any subclasses.
Private: Can only be seen by the class.
The accessor modifiers apply the restrictions to reading and writing. Either you see it and can do anything or you don't and can't!
Regards,
Manfred.
 
Conrad Kirby
Ranch Hand
Posts: 178
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well thankee kindly! I'll just mosey on back to work!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic