public class ByteArr { public static void main(String[] args){ Byte[] a = {(byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00}; Byte[] b = {(byte)0x
As byte[] is mutable it is treated as only being .equals() if its the same object.
.equals()
If you want to compare the contents you have to use Arrays.equals(a, b)
Arrays.equals(a, b)
BTW: Its not the way I would design it. ;)