The zero-based JAVA-3. Data types for Java

Source: Internet
Author: User

1. Data types can be divided into 2 categories: basic data types and composite data types.

Basic data types: integer, float, character, and character

Composite data types: array type, class, interface

Basic data Types1. Integral type Basic type (int) Short-Integer ( Short) long-integer (Long) byte type (byte)2. Floating-point single-precision number (float) and double-precision numbers (Double)3the character type in character Java is represented by Char. He uses 2 bytes (16 bits) to hold a character, and it does not store ASCII code but Unicode code. A Unicode code is a character encoding that is used on a computer. He sets a uniform and unique binary encoding for each character in each language. And Unicode is ASCII code-compatible with all ASCII characters, will be added in the high-byte position 0, to become a Unicode code. For example: The ASCII code A is 0x61, in Unicode, the encoding is 0x0061.4. Boolean Type Boolean (Boolean). Used for processing logic is worthwhile. Take only 2 valuestrueAndfalseThe conditions are either established or not established, respectively.

2. Integral type data

Can be divided into integer constants and integer variables

Integral type constant

integer constants consist of one or more numbers that can be signed, and are divided into decimal, octal, and hexadecimal according to the different binary types. Decimal: 123,-123,0 octal : Specifies that the octal number begins with 0. For example, 0123 means octal number 123, equal to decimal, 011 equals decimal -9. 16 binary: Hexadecimal number starting with 0x or 0X

Integer variable

integer variables can be divided into byte type (byte), short integer (Long), and basictype (int) in different bytes.

3. Transfer sequence and its meaning

character form      meaning \ n               newline \ t                horizontal tab \v                vertical jump lattice \b               backspace \ r                return                 \ \ backslash "\" \ "                 \ "               double quotes" ""\uhhhh       Unicode codes represented by 1-4-bit 16 binary numbers

Zero-based JAVA-3. Java Data type

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.