简体   繁体   English

Java中的字节原语

[英]Byte primitive in Java

I have been working on a project with images and I read on internet that working in byte for images solves alot of problems and improve efficiency. 我一直在研究带有图像的项目,并且在互联网上阅读到以byte为单位处理图像可以解决许多问题并提高效率。 I tried to google it but didn't find any definition for it. 我试图用Google搜索它,但没有找到任何定义。 So I came here to ask 所以我来这里问

  • What is byte in Java? Java中的字节是什么? What is it use? 有什么用?

You can read the Java tutorials . 您可以阅读Java教程

byte: The byte data type is an 8-bit signed two's complement integer. byte:字节数据类型是8位带符号的二进制补码整数。 It has a minimum value of -128 and a maximum value of 127 (inclusive). 最小值为-128,最大值为127(含)。 The byte data type can be useful for saving memory in large arrays, where the memory savings actually matters. 字节数据类型对于在大数组中节省内存非常有用,因为内存节省实际上很重要。 They can also be used in place of int where their limits help to clarify your code; 在限制可以帮助您澄清代码的地方,也可以使用它们来代替int。 the fact that a variable's range is limited can serve as a form of documentation. 变量范围有限的事实可以作为文档的一种形式。

byte is one of the primitive types of java. byte是Java的原始类型之一。 Is an abstraction of a byte (8 bit integer with sign). 是字节( 符号的8位整数)的抽象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM