Java Basic data types

Source: Internet
Author: User

There are eight Java basic data types, roughly divided into three categories:

First Class (character type): Char

Class II (Boolean type): Boolean

Class III (numeric type): integer type: byte,short,int,long/floating-point type: float,double

Comparison of the basic data types

Basic type Packing class Minimum value Maximum Value Number of bytes Number of binary digits
Byte Java.lang.Byte -128 127 1 8
Short Java.lang.Short -32768 32767 2 16
Int Java.lang.Integer -2147483648 2147483647 4 32
Long Java.lang.Long -9.22337E+18 9.22337E+18 8 64
Float Java.lang.Float 1.40E-45 3.40E+38 4 32
Double Java.lang.Double 4.9E-324 1.7976931348623157E308 8 64
Char Java.lang.Character 0 65535 2 16

Java Basic data types

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.