Take a look at the code
Import java.util.*;
Class book{
static int c = NULL;
}
public static void Main (string[] args) {
Book Book1 = new book ();
Book Book2 = new book ();
book1.c = 6;
book2.c = 4;
Book1 = Book2;
}
Above, when Book1 and Book2 two objects are assigned to each other, then when we call BOOK.C, we will find that book1.c and book2.c are equal
Cause: We operate directly on the object, because the reference to the object of Book1 and Book2 is the same object, so there is a special appellation, called, alias phenomenon
So how do we expect the two variables to be independent of one another? We should use this, as follows:
book1.c = book2.c;
Thus, the properties of different objects can be assigned to each other, because the properties of different objects are independent of each other
aliasing, mutual assignment between Java objects