Please see the following lines of code mentioned below:
byte[] a = { 1, 2, 3, 4 }; byte[] b = a; // b will have all values of a. a = null;
You are making b point to the memory address that contains the byte array. Then afterwards, you are making a point to null. b remains unchanged.
b
byte
a
null