- #1
kirkulator
- 33
- 0
CAN SOMEONE PLEASE explain the "this." keyword in java to me?!
"the this keyword can be used to refer to the calling object or used inside one constructor to invoke another in its own class.
I understand how it invokes another constructor. But i do not understand why i keep seeing this code within methods of class'.
When should i use this keyword? When i have multiple objects in a class, and what does it even mean when I am typing it?
Im so confused and my professor refuses to explain. Thanks so much,
Amanda
"the this keyword can be used to refer to the calling object or used inside one constructor to invoke another in its own class.
I understand how it invokes another constructor. But i do not understand why i keep seeing this code within methods of class'.
When should i use this keyword? When i have multiple objects in a class, and what does it even mean when I am typing it?
Im so confused and my professor refuses to explain. Thanks so much,
Amanda