Basic data types based on JAVA, java Data Types

Source: Internet
Author: User

Basic data types based on JAVA, java Data Types

Basic Data Type:

1. numeric type 1) integer: 1. byte: one byte, eight digits. value range: 0 ~ 255, used to store binary data. 2. Two short bytes, 16 bits. The value range is-32768 ~ In the range of 32767. 3. Four int bytes, 32 bits, value range:-2147483648 ~ The value range is-2147483648. The value range is-9,223,372,036,854,775,808 ~ Between 9,223,372,036,854,775,807 and 2) float: 1. float, four bytes, single-precision floating point number, range:-2 ^ 128
~ + 2 ^ 1282, double, eight-byte double-precision floating point number, range:-2 ^ 1024
~ + 2 ^ 1024 II. String: char, a set of data. 3. boolean: boolean. There are only two values. One value is true and the other value is false. 4. String: String, basic data type conversion: from low to advanced, char → int → long → float → doublebyte → short → int can be automatically converted to double num1 = 78.2; int num2 = (double) num1

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.