Java Basic Data Types

Source: Internet
Author: User

One byte has eight bits, which are 8 0 and 1

The first digit of the eight digits is the symbol digit. 0 indicates positive and 1 indicates negative. Therefore, data types in Java are both positive and negative, and there is no unsigned number.

That is to say, 0000 0001 represents number 1,

1000 0001 represents-1

Therefore, if a positive number has a maximum of 0111 digits, it is converted to decimal format, that is, the number is 1111.

The maximum number of negative numbers is 1111, which is-1111.

There are eight numbers. There are two possibilities for a single number. The total number may be the power of 2, 256, and half of one side. Therefore, the decimal range of a byte is-128 ~ 127

 

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.