Hello everyone. I'm looking to better understand what's going on in a couple occassions, in Java. Thanks in advance.
1.
Object[] a = new Object[10];
Object[] b = a; //ok, what happens here. does all of 'a' get copied into 'b' or is 'b' a reference of 'a' and whatever I do to 'b' will be done to 'a'?
2.
Object[] a = new Object[10];
for (int i = 0; i < 10; i++) {
a = new Object();
}
a = new Object[2]; //is all the previous data going to be removed from memory here? What about if I set the array to null instead, then will it be removed from memory?