帮忙看一下代码的错误,谢谢
public class Coner1 {
public static byte[]int2bytes(int id){
byte[] arr=new byte[4];//创建一个数组,长度为四
arr[0]=(byte)((int)id>>0*8 && 0xff);//0xff报错Oxff cannot be resolved to a variable
arr[1]=(byte)((int)id>>1*8 && 0xff);
arr[2]=(byte)((int)id>>2*8 && 0xff);
arr[3]=(byte)((int)id>>3*8 && 0xff);
return arr;
}
public static void main(String[] args) {
byte[]arr=Coner1.int2bytes(8143);
System.out.println(arr[0]+","arr[1]+","arr[2]+","arr[3]);//arr报错
}
}