public class ByteArr { public static void main(String[] args){ Byte[] a = {(byte)0x03, (byte)0x00, (byte)0x00, (byte)0x00}; Byte[] b = {(byte)0x
Because neither == nor the equals() method of the array compare the contents; both only evaluate object identity (== always does, and equals() is not overwritten, so the version from Object is being used).
==
equals()
Object
For comparing the contents, use Arrays.equals().