在Java中有没有人使用短或字节? [英] In Java does anyone use short or byte?

查看:138
本文介绍了在Java中有没有人使用短或字节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了在流式传输中使用(byte [])我不太明白字节和短的使用。另一方面,我看到很久以前,实际值是| 100 |并且字节会更合适。这是现在记忆的相对廉价性质的后果还是开发人员不用担心的这个细节呢?

Apart from using (byte[]) in streaming I don't really see byte and short used much. On the other hand I have seen long used where the actual value is |100| and byte would be more appropriate. Is this a consequence of the relative inexpensive nature of memory now or is this just minutia that developers needn't worry about?

推荐答案

当对内存或磁盘空间不足的嵌入式设备进行编程时,会使用它们。例如电器和其他电子设备。

They are used when programming for embedded devices that are short on memory or disk space. Such as appliances and other electronic devices.

字节也用于低级Web编程,您可以使用头文件等向Web服务器发送请求。

Byte is also used in low level web programming, where you send requests to web servers using headers, etc.

这篇关于在Java中有没有人使用短或字节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆