When a variable is declared, it is declared with a particular type. The type tells what kind of values the variable can have, and what the possible operations on that type are.
There are eight primitive types in Java; these are the basic building blocks from which all other types are constructed. In addition, Java defines literally thousands of object types, and every program you write has additional programmer-defined object types of its own. Every class defines a type.
int is a primitive type that can have integer values,
and the operations add, subtract, multiply, divide, and several others.
an object type supplied by Java, with operations such as
substring. When you write a program, you might define a type (class) named
Employee with operations