In Java the word "variable" and "field" are interchangeable. The purpose of a variable is to store a value. That value could be numeric, text, boolean, or a memory address. The type of value that a variable stores is dependent on the variable data type.
Java has two classifications of variable data types, they are known as primitive and non-primitive. A primitive data type contains the value directly, a non-primitive data-type contains a reference to a object. (reference to an object is a memory location where the attributes and state of the object are stored)
Java has eight primitive data types:
char byte
short int
long float
double boolean
If preparing for the AP Computer Science A Exam, students only need to be familiar with three of the primitive data type: int, double, and boolean. The following link provides a description of the Java topics tested on the AP Computer Science Exam A.
https://secure-media.collegeboard.org/digitalServices/pdf/ap/ap-computer-science-a-java-subset.pdf
Data Type - Max and Min Values
In the code shown below, we ask Java to tell us the minimum and maximum values for each of the primitive data types. This information is necessary because if our program has the potential to exceed a data type's limits the result will be erroneous due to all precision being lost. Also, notice the plus symbol in between the text and the Java expression. When the plus symbol is used to join text with other text or to join text with numbers it is called a concatenation operator. This operation converts non-String data into String data as it combines it with other Strings. However, if the plus is between two numeric values it would be treated as addition.
Non-Primitive Variables
Non-primitive data types are also called reference types. These data types do not directly store a value, but rather store a memory reference to an object. Objects consist of classes, interfaces, and arrays. Data types such as String, Scanner, and Object are non-primitive data types and are the first of the non-primitive types we will encounter.