search
HomeJavaJavagetting StartedWhat are the commonly used data types in java

What are the commonly used data types in java

Dec 02, 2019 pm 04:29 PM
javatype of data

What are the commonly used data types in java

Data types in Java are divided into basic data types and reference data types.

Basic data types

1. 4 integer types

byte 1 byte -128——127

short 2 bytes -32,768 —— 32,767

int 4 bytes ——2,147,483,648 ——2,147,483,647 (more than 2 billion)

long 8 bytes -9,223,372,036,854,775,808——9,223,372,036854 ,775,807

Note: The number of bytes occupied by all data classes in Java has nothing to do with the platform, and Java does not have any unsigned types

Online learning video recommendations: java Online Tutorial

2. Two floating point types

float 4 bytes Single precision (significant digits 6 – 7 digits)

double 8 bytes Double precision (15 significant digits)

3. 1 Unicode encoded character unit

char 2 bytes The entire Unicode character set

4. 1 A Boolean type

boolean 1 bit True or false

Reference data type

1. Class class

2. Interface interface

3. Array array

Recommended related articles and tutorials: java introductory tutorial

The above is the detailed content of What are the commonly used data types in java. For more information, please follow other related articles on the PHP Chinese website!

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Atom editor mac version download

Atom editor mac version download

The most popular open source editor