Home > Java > JavaBase > body text

what is type in java

angryTom
Release: 2019-11-16 09:25:47
Original
5335 people have browsed it

what is type in java

What is a type in java

The type mentioned in the java programming language usually refers to the data 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:

what is type in java

##Built-in data types

byteshort intlongfloatdoublebooleanchar

##Reference type

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template