Logo 
Search:

Java Articles

Submit Article
Home » Articles » Java » FundamentalRSS Feeds

Variable modifiers in java

Posted By: Jeanette Greene     Category: Java     Views: 5947

This article explains about variable modifiers available in java with example.

There are seven possible modifiers that may precede the declaration of a variable as listed below.

 Keyword

Description 

 final

Is a constant 

 private

Can be accessed only by code in the same class 

 protected

Can be accessed only by code in a subclass or the same package 

 public

Can be accessed by any other class 

 static

Is not an instance variable 

 transient

Is not part of the persistent state of this class 

 volatile

Can change unexpectedly 

  
Share: 

 
 
 

Didn't find what you were looking for? Find more on Variable modifiers in java Or get search suggestion and latest updates.

Jeanette Greene
Jeanette Greene author of Variable modifiers in java is from Wichita , United States. Jeanette Greene says

 
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!