Social Media

Java Access Control

Java access control is pretty simple –

Class Level (including enum) – 2 Types

  • Default – Can only be seen within class
  • public – Can be seen from anywhere

Methods and Variables

  • public – Can be seen anywhere
  • protected – Package and Subclasses
  • default – Package Private
  • private – Class Only

About the Author Martin Farrell

My name is Martin Farrell. I have almost 20 years Java experience. I specialize inthe Spring Framework and JEE. I’ve consulted to a range of businesses, and have provide Java and Spring mentoring and training. You can learn more at About or on my consultancy website Glendevon Software

follow me on:

Leave a Comment: