Object fields are the data or state that each object of a class will have. Class (static) fields are in the object that defines the class so there is only one and all objects of the class have access to it. Fields are defined inside of a class definition. The convention is to start field names with a lowercase letter and uppercase the first letter of each additional word.
To declare an object field, use:
visibility type name;
To declare a field and give it a value, use:
visibility type name = expression;
The visibility for fields is usually private so that an object can protect its data from being directly accessed by code in other classes.
To declare a class field, use:
visibility static type name;
To declare a constant field, use:
public static final type name;