Java basic data type Addendum

Source: Internet
Author: User

It is easy to ignore.

1. All numeric types have positive and negative signs, so do not look for unsigned numeric types.

 

2. The size of the bucket occupied by the boolean type is not explicitly specified. It is defined as true or false.

 

3. The package class of the basic type allows you to create a non-basic object in the heap to indicate the corresponding basic type.

 

4. High-Precision numbers

Java provides two classes for high-precision computing: biginteger and bigdecimal. Although they generally fall into the "Wrapper class" category, neither of them has a corresponding basic type.

However, the methods contained in these two classes provide similar operations for basic types. That is to say, the int and float operations can also be applied to biginteger or bigdecimal operations. However, you must replace the operator with the method call method. This process is complicated, so the computing speed is slow. Here, we exchange speed for accuracy. Biginteger supports Integers of any precision. That is to say, in an operation, an integer of any size can be accurately expressed without any information loss. Bigdecimal supports the number of points with any precision. For example, it can be used for precise currency calculation.

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.