Java Data types

Source: Internet
Author: User

1. Basic type: Long8,int4,byte1,float4,double8,char2,boolean,short2

No attribute method, only mathematical operation, cannot save null;

All basic data types in Java have a fixed storage range and the size of the occupied memory space, and are not affected by the specific operating system to ensure the portability of Java programs

2. Conversions between basic data types

Automatic type conversion: Small capacity can be automatically converted to large-capacity data types,

Forced type conversions: Large capacity conversion to small capacity with possible accuracy reduction or data overflow

3. Object type (Class): Long,integer,byte,float,double,char,string ....

There are property methods that can set NULL values

Long is a long wrapper class, other similar

4. Crating and Unpacking

JDK5.0 provides automatic boxing and unpacking for basic data types

  

Java Data types

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.