如何声明array
java中unsigned char数据类型。
我尝试做private unsigned char[] Memory = new char[64000];
,但它给出的错误是 <identifier> expected
我的项目说:
内存寻址为 16 位
内存通过取64K的字节(unsigned char)数组来模拟
所有内存引用均通过内存和通用寄存器之间的加载和存储指令
每个进程的堆栈大小为 50 字节
最佳答案
Java 中的 char 始终是无符号的:
4.2.1. Integral Types and Values
The values of the integral types are integers in the following ranges:
...
For char, from '\u0000' to '\uffff' inclusive, that is, from 0 to 65535
因此,只需写:
private char[] Memory = new char[64000];
关于java - 如何在java中声明unsigned char数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28914634/