In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what is the value range of Byte in Java". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the value range of Byte in Java".
The value range of Byte in Java
The basic concept bit bit represents the binary bit, which is the smallest unit of data storage in the computer, and 11010100 is an 8-bit binary number. One binary bit can only represent 0 and 1 states; two binary bits can represent 00, 01, 10, 11 states. Byte byte is the basic unit of data processing in a computer. In a computer, information is stored and interpreted in byte units, specifying that a byte consists of eight binary bits, that is, a byte equals eight bits (1Byte=8bit). Basic concepts two original code, inverse code and complement code
Positive and negative numbers in JAVA
In JAVA, the binary number is represented by the complement, the highest bit of the complement is the symbol bit, the highest bit is "0" for positive number, and the highest bit is "1" for negative number. The complement of a positive number is itself, and the complement of a negative number is its absolute value (that is, a positive number) plus 1. Here is the difference between anti-code and anti-code, including symbol bits.
The byte is 8 bits per byte, and the highest bit is the symbol bit. When the number is positive, the maximum value is 01111111 (complement), 01111111 (inverse code), 01111111 (source code), so the maximum positive number is 127th.
When the number is negative: the minimum value is 10000000 (complement), 01111111 (first subtract 1 to get the inverse code), 10000000 (then take the reverse to get the source code), so the negative number is the minimum worthwhile absolute value is 2 ^ 7 = 128, that is-128,
The maximum value of JAVAbyte is 127and the minimum value is indeed-128. (- 128 / 127)
Thank you for your reading, the above is "what is the value range of Byte in Java". After the study of this article, I believe you have a deeper understanding of the value range of Byte in Java, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.