Java data type, java Basic Data Type

Source: Internet
Author: User

Java data type, java Basic Data Type
I. Java Data Type

1. Basic data type

2. Reference Data Type

Ii. Basic Data Types
1. Integer type: bytr, short, int, long
2. Floating Point Data Types: float and double
3. Character Type: char
4. boolean type: bollean

Type name byte space type description
Byte 1-byte (8-bit) Stores 1-byte data
Short 2-byte (16-bit) Compatibility considerations, generally not used
Int 4-byte (32-bit) Storage INTEGER (commonly used)
Long 8-byte (64-bit) storage of long integers (commonly used)
Float 4-byte (32-bit) storage of Floating Point Numbers
Double 8-byte (64-bit) storage double-precision floating point number
Char 2-byte (16-bit) storage of one byte
Boolean 1-byte (8-bit) Storage logic variable

 

Step: a. Declare the variable (int I ;)
B. assign values (I = 1;) or ------ int I = 1;
C. Use Variables

 

A. The default Integer type is int.
B. to define data of the long type, add l or L to the data
C. The default value of the floating point type is double.
D. Define float data. f or F must be added to the data.
E. When double is used, d or D can be added to the backend, which is generally omitted.
F. char indicates the character type. Data should be placed in ''when values are assigned.

* Note: String is not of the 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.