Have never heard of these two nouns, these days with the list and map of the time to find the bug, only for the first time on the StackOverflow know there are so two simple terminology can describe the problems I encountered.
Written down is based on their own understanding, perhaps inaccurate, if later found not to come back to fix.
First, there are only two types of data in Java: Primitive type and object type.
The basic data type (primitive type) is assigned with only one case, because their memory location is the location of their actual value, and if one variable is assigned to another variable, a new value is added to the memory.
There are two cases of a reference type (object), because the object itself has two values. One is the memory address and the other is the value of the object itself that this memory address holds. When you assign a variable to another variable, there are two things:
1. Copy only the memory address to the new variable, in which case two variables point to the same memory location, and any one variable modifies it to affect the other variable. This is called the shallow copy.
2. Re-generate the value of object, that is, two variables, although the values are equal, but in memory has a different position, each other does not affect each other. This is deep copy.
In fact, I do not want to get what circumstances to shallow copy, it seems to be an extra variable AH.
Deep copy and shallow copy in Java