Java basic data types for development learning

Source: Internet
Author: User

data types are essential to each programming language, but also the skills that must be mastered, a lot of people's knowledge is simple to understand, and not very systematic to comb the knowledge, the following is a summary of the Java language built-in data types:

There are 8 basic types of Java languages. 6 numeric types (4 integer, 2 float), 1 character type, 1 Boolean.

One, Byte:

? The byte data type is a 8-bit, signed, integer in binary complement notation;

? The minimum value is-128 ( -2^7);

? The maximum value is 127 (2^7-1);

? The default value is 0;

? The byte type mainly replaces integers because it occupies only one-fourth of the type int;

Second, short:

? The short data type is a 16-bit, signed, Integer that is represented by a binary complement

? The minimum value is-32768 ( -2^15);

? The maximum value is 32767 (2^15-1);

? Short types can also save space. The space occupied is one-second of the int type;

? The default value is 0;

Three, int:

? The int data type is a 32-bit, signed integer that is represented by a binary complement;

? The minimum value is-2,147,483,648 ( -2^31);

? The maximum value is 2,147,485,647 (2^31-1);

? The generic integer variable defaults to the int type;

? The default value is 0;

Four, Long:

? The Long data type is a 64-bit, signed, integer in binary complement notation;

? The minimum value is-9,223,372,036,854,775,808 ( -2^63);

? The maximum value is 9,223,372,036,854,775,807 (2^63-1);

? Mainly used on systems that require larger integers;

? The default value is 0L;

Five, float:

? Float data type is a single-precision, 32-bit, character IEEE754 standard floating-point number;

? Float saves memory when storing large floating-point groups;

? The default value is 0.0f;

? Floating-point numbers cannot represent exact values, such as currency;

Six, double:

? The double data type is a dual-precision, 64-bit, IEEE 754-compliant floating-point number;

? The default type of floating-point number is double type;

? Cannot represent exact values, such as currency;

? The default value is 0.0d;

Seven, Boolean:

? Only two values: true and false;

? Only used for recording true/false situation;

? The default value is false;

Eight, Char:

? The char type is a single 16-bit Unicode character;

? The minimum value is ' \u0000 ' (that is, 0);

? The maximum value is ' \uffff ' (that is, 65,535);

? Char data type can store any character;

The above is the old boy education on Java data type introduction, want to learn more information, come to join the old boys to teach Java training, let you easily master more practical Java skills!


Java basic data types for development learning

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.