What is a type in java
The type mentioned in the java programming language usually refers to thedata type, Java language provides eight basic types. Six numeric types (four integers, two floating point types), a character type, and a Boolean type. At the same time, Java also has reference types (objects, arrays, etc.).Recommended: "Java Tutorial"
The definition of data type in the data structure is a group of the same properties The collective name of a collection of values and a set of operations defined on this collection of values; variables are used to store values, and they have names and data types. The data type of a variable determines how the bits representing those values are stored in the computer's memory.
Java data type classification:
##Built-in data types
short | int | long | |
double | boolean | char |
Reference type variables are created by the constructor of the class, and you can use them to access the referenced object. These variables are specified as a specific type when declared, such as Employee, Pubby, etc. Once a variable is declared, its type cannot be changed.
Objects and arrays are reference data types.
The default value of all reference types is null.
A reference variable can be used to reference any type that is compatible with it.
Example: Animal animal = new Animal("giraffe").
The above is the detailed content of what is type in java. For more information, please follow other related articles on the PHP Chinese website!