//java.lang包下 StringUTF16类下的 equals算法
@HotSpotIntrinsicCandidate
public static boolean equals(byte[] value, byte[] other) {
if (value.length == other.length) { int len = value.length >> 1;//此段代码是什么意思
for (int i = 0; i < len; i++) {
if (getChar(value, i) != getChar(other, i)) {
return false;
}
}
return true;
}
return false;
}
...全文
93114打赏收藏
关于equals算法的疑惑
//java.lang包下 StringUTF16类下的 equals算法 @HotSpotIntrinsicCandidate public static boolean equals(byte[] value, byte[] other) { if (value.length == other.length) { int len = value.length >> 1;//此段代码是什么意思 for (int i = 0; i < len; i++) { if (getChar(value
public class Tester4 {
public static void main(String[] args){
int a=15;//1111
System.out.println(a>>1);//0111
int b=4;//0100
System.out.println(b>>1);//0010
}
}