Fields in java class

This page discusses - Fields in java class

Fields in java class


In this section, we will explore the concept of the fields in the reference of object oriented programming techniques.

There are two part of the field first is type of field and other one is the name part. We can also define the visibility of that field. There are four type of visibility of that:

Public: The field can be access in the entire class.

Protected: The field define in this section will access by the class, subclass or classes in the same package.

Private: This type of field can be access by the same elements of the class.

Package: The field can be access by any class objects from classes inside the same package in which the field is defined.

We can also define the modification style of the field. There are also four type of modification style.

Static: This type of modifiers are define to the class not to the object.

Transient: This type of field is use to store for the constant value.

Final: The field can not be changed from its assigned value.

Volatile: This type of field can be customized as you might expect at the same time of running threads.

Share on Google+Share on Google+

Fields in java class

Posted on: April 17, 2011 If you enjoyed this post then why not add us on Google+? Add us to your Circles



Discuss: Fields in java class  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
Parikh Viranchi
August 23, 2012

pls try to improve your website pls what we want is never answered here i just advice you to give ans according to the question pls i hope when ever by mistake also i opened your website i shall see something better than this.... that is a hope:(