<分区>
我有两个整数要比较。第一个整数是从一个 utf-8 字节创建的,第二个整数是我要检查它是否相等的整数。
int a = 106;
int b = (int)byteArray[0]; //which actually equals 106 when you printstatement it
但是....
(a==b) //always equals false
int i = 0; While(b != i) { println(i); i++;} //eventually escapes the loop and is true
创建时是否也引用了图元?为什么 a 永远不会等于 b,除非我一直数到 106?
有没有更好的方法来比较字节?因为我已经尝试了所有形式的变量,但它们也不起作用。