• Support PF! Buy your school textbooks, materials and every day products Here!

CAN SOMEONE PLEASE explain the this. keyword in java to me?

  • Comp Sci
  • Thread starter kirkulator
  • Start date
  • #1
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 im typing it?

Im so confused and my professor refuses to explain. Thanks so much,

Amanda
 

Answers and Replies

Related Threads on CAN SOMEONE PLEASE explain the this. keyword in java to me?

Replies
2
Views
1K
Replies
3
Views
1K
  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
1
Views
1K
Replies
10
Views
4K
Replies
2
Views
751
Top