Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Java:Tutorial - Access Modifiers


  • Please log in to reply
No replies to this topic

#1 John

John

    CC Mentor

  • Moderator
  • 4450 posts
  • Location:New York, NY

Posted 09 December 2006 - 07:57 AM

Access control modifiers express a programming entities ability to be recognized and available to other programming entities. Inside a program there are something things that we want to make public, meaning other parts of the program have access to them, and there are something things we do not want to make public in which we would use the private access modifier. There is also a protected access modifier, which is less common than public and private. Entities that are giving the protected access modifier may be accessed by other classes in the same package or from any subclasses of the class in which they are declared. Access modifiers can be used for variables and methods.

For example:
[B]public [/B]int x;
[B]private [/B]int y;
[B]public [/B]class myClass(){

  • 0




Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download