8 Basic data types of Java

Source: Internet
Author: User

8 Basic data types of Java

Byte 8bit 2^8=256 -128-127
Short 16bit 2^16=65535
Int 32bit 2^32
Long 64bit 2^64
Float 32bit

Double 64bit

Boolean 1 bytes or 4


Char 16bit

If an integer is not added to any of the identifiers, the default is int, and if you need to represent the data as a long type, you need to add L to the data, not case-sensitive, and we recommend Capitalization.


If a floating-point number is not added to any identity, the default is double, and if it is required to be expressed as a float type, a decimal is followed by a f,f case-insensitive, usually lowercase.


If the Boolean represents the base type when it occupies 4 bytes, the element of the array is 1 bytes when the array is Represented.

This article is from the "rain or keep falling" blog, please be sure to keep this source http://8869176.blog.51cto.com/8859176/1866926

8 Basic data types of Java

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.