Java Modifiers Types Definition

Java Modifiers Types

So, folks.. first of all what goes through your mind when you hear “modify”, well for me when I hear that word the simplest meaning is to “change”. So what is a modifier, basically modifiers (In java) are a keywords that you can add to those definitions to change their meanings. In the java language there are a wide range of variety for java modifiers types, including the following modifiers :

  • Java Access Modifiers 
  • Java Non Access Modifiers

Access Modifiers 

Java of course provides numbers of access modifiers hence to set the access level for class, methods, constructors and variables. These are the four access levels :

 

  1. Content are Visible to the package, the default. And no modifiers are needed here.
  2. Private : Contents are visible to its class only
  3. Content are Visible to everyone and basically the world (public).
  4. Protected : Contents are visible to the package and all of its subclasses

Non-Acess Modifiers

Most noteworthy Java also provides numbers of non-access modifiers that you/we to achieve a lot of other functionality.
  1. The static modifier is usually used to create class methods and variables.
  2. The final modifier is usually used to finalize the implementation of classes, methods and of course variables.
  3. The synchronized and volatile modifiers (probably the least modifiers that you’ve ever heard) and of course this modifiers are used for threads.
  4. The abstract modifier is to create abstract classes and methods.
 

 

3 thoughts on “Java Modifiers Types Definition”

Leave a Reply

Your email address will not be published. Required fields are marked *