Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » FundamentalRSS Feeds

Method Modifiers

Posted By: Mathew Stewart     Category: Java     Views: 1900

This article explains about method modifiers in java with example.

There are eight possible modifiers that may precede the declaration of a method as listed below.

 Keyword

Description 

 abstract 

Is not implemented by a class containing it 

 final

May not be overridden 

 native

The method is implemented in the machine code used by the host CPU, not using java bytecodes 

 private

Can be invoked by code in the same class 

 protected 

Can be invoked by code in a subclass or the same package 

 public

Can be invoked by any other class 

 static

 Is not an instance method

 synchronized

Acquires a lock when it begins execution 

  
Share: 

 
 
 

Didn't find what you were looking for? Find more on Method Modifiers Or get search suggestion and latest updates.

Mathew Stewart
Mathew Stewart author of Method Modifiers is from Houston, United States.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!