The Java data type is signed, which differs from some unsigned

Source: Internet
Author: User

For Java data types, we only have signed data types, such as Short's representation range-128 to +127, which represents the signed data type.

Java has no unsigned type and is a data type of the signed type. But other languages, such as the unsigned short unsigned number of C, have a range of values starting from 0 and a larger range of data than the Java short type.

In the actual development, may want to write with C hardware interface, network interface with each other direct data interaction, at this time because Java does not have unsigned data types, resulting in Java and C seemingly the same data type, in fact, the storage space is really different, this problem solving method is Java with higher storage data type, If c uses int, your Java will have to consider a long or biginteger. Another way is to use Java's Guava framework to achieve your goals. You can actually write it yourself, but it's easy to get a problem.

The Java data type is signed, which differs from some unsigned

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.