Introduction to Java modifiers

Java modifiers are split into two categories :

  • Access modifiers;
  • Non-access modifiers.

Access modifiers are the “responsible” for determining the accessibility of a class, an interface and their methods and variables. In Java there are three access modifiers :

  • public;
  • protected;
  • private.

and, four access levels :

  • public;
  • protected;
  • private;
  • default.

Non-access modifiers are used to assign special privileges, responsibilities, and behavior to the Java types and entities. Non-access modifiers which can be used to characterize the java classes, interfaces, methods and variables  are :

  • abstract;
  • final;
  • static;
  • synchronized;
  • native;
  • strictfp;
  • transient;
  • volatile.

The Java Certification OCA 7 Programmer I requires to know only three of the non-access modifiers : abstract, final and static.

One Comment

Add a Comment

Your email address will not be published.