Java Foundation---this keyword
Before online read a lot of blog, all kinds of this keyword interpretation, but said is very vague, read and read almost, or do not understand, until see the Great God's blog-(aloof Wolf), suddenly wake up. This is used to prevent forgetting, close-up write this blog in mind and share. The lack of writing is welcome to correct me.
this keyword
first of all, I understand this keyword, this is a reference to an object or to understand an alias, such as you new object, the following code, for example, the leaf leaf=new leaf (); this.i==>leaf.i; that is, the leaf (the object's reference) points to an object that is equal to the object pointed to by this (reference to the object). Again, the this.i I, refers to the leaf object inside of I, and then more popular point is the int i=0---this i.
For example, deepen understanding, such as in the hospital just born a child, give him a name called--nan God, then now Nan god-------> Children, this is equivalent to a new object (child), and then gave him a reference (Nan God), at this moment, you say Nan God's face is very handsome, In our professional terminology, nancy. face = handsome; But the other said, the child's face is handsome, and then replaced by the professional term this. face = Handsome; this, Nan God refers to the child this object; haha this is my own understanding, the shortcomings of the welcome to correct.
In addition to the explanation of the great God
Paste the code:
This--java Foundation---who is this??