判断奇偶性
二进制 &
public boolean isValid(String str) {
int len = str.length();
return (len & 1) != 1;
}
0000 0101
&
0000 0001
=
0000 0001
10进制 %
public boolean isValid(String str) {
int len = str.length();
return len % 2 != 1;
}
标签:10,判断,0000,奇偶性,len,str,return From: https://www.cnblogs.com/liuzonglin/p/16724711.html10 % 2 == 0
11 % 2 == 1