Eighth Week Java Learning
This week, the teacher led us to improve the inheritance, excuses, copies, lambda expressions, internal categories lack, imperfect place, help us to check the gaps.
as an example of copy learning, I had a very superficial understanding of the copy, the deep copy and the shallow copy is: Deep copy is to create a new object, contrast shallow copy, change the copy of the object properties will not affect the original object. After more careful study, it is understood that there are three ways to copy a reference to an object to another object. The first method is direct assignment , the second is a shallow copy , the third is a deep copy, and their essence is copy, copy. a basic data type, there are two ways to copy it: (1) Create a new object and copy the non-static field of the current object to the new object, copy the field if the field is a value type, or copy the reference without copying the referenced object if the field is a reference type. Therefore, the original object and its copy refer to the same object. (2) creates a new object and then copies the non-static fields of the current object to the new object, whether the field is a value type or a reference type. These two copies are called Light and deep copies, respectively. in my opinion, the dead point of a shallow copy is that the original object and its copy refer to the same object, while a deep copy keeps them from pointing to the same object.
Overall, this week's study is very rewarding, but in the experiment still encountered a lot of difficulties, interface settings, sub-class function allocation, the function of the main function coordination, I hope the teacher will lead us to design, complete a program, exercise our program design capabilities.
201671010140.2016-2017-2 Java Program Eighth week of Java learning