JAVA Basic Notes

Java fields are variables within Java classes. Both Java fields and methods have a type, or the type of data they contain (such as an int or double). A field is a member variable that belongs to a class. 

Field Summary of Java System Class

Modifier and type of fieldFieldDescription
static PrintStreamerrIt is the standard error output stream
static InputStreaminIt is the standard input stream
static PrintStreamoutIt is the standard output stream

The difference is that a field affects everything in the class and every instance of that class. A variable affects only what’s in the method for which it is defined.