Java Data type partitioning (2 kinds) __java

Source: Internet
Author: User

1. Basic Data Types
No memory allocation issues involved. It is divided into eight types: Byte, short, int, long, float, double, char, Boolean, respectively. The default values are as shown in the figure:

2. Reference data type
Developers are required to allocate space for them. It is divided into three kinds, namely array, class, interface. The default values are as shown in the figure:

* * Personal selection data type principle (99% General):

* * If you want to represent integers, use int, which means decimal is used, if you want to describe a date-time number or a file (or memory) size with long, if you want to implement content transfer or encoding conversion using Byte, you can use Booleam if you want to implement logical control; If you want to use Chinese, use char to avoid Chinese garbled; If you follow the Save range: Byte < int < long < double;

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.