Java Basics - Data Types

Disclaimer: The materials used in this column are written by VIP students of Kaige Academy. Students have the right to remain anonymous and have the right to final interpretation of the article. Kaige Academy aims to promote VIP students to learn from each other based on public notes.

1. Data types (eight types):

image

1. The computer's storage carry: bit is the smallest unit of storage data, and so on, as shown in the figure:

image

image

2. In java we can use 0b or 0x to represent binary and hexadecimal

Such as: 0xABC or 0b01010001;

3. In the data storage in java, the high bit is 1 is a negative number, and the high bit is 0 is a positive number;

4. Detailed explanation of Java data types:

Integer value: int short: less than 32767 byte: less than 127

Decimal value: double

Single quotes: char (numbers can be assigned) boolean: true, false

①Integer type (four types): byte short int long, as shown in the figure:

image

image

②Character type: char, as shown in the figure:

image

③Floating point type: float double

image

④ Boolean type: boolean

image

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326796561&siteId=291194637