Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

this in java

 
Raj kalaria
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one clear my concepts of this key word in java . I always get confused can plz some one explain me . i would appreciate it
 
kwame Iwegbue
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is usually used to refer to the current instance, in cases where there might be some ambiguity about which variable you're referring to.

 
Raj kalaria
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you
 
Ko Wey
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope I don't write anything foolish, but I see it as
a reference to the current instance of the class, the "thing" that
is constructed by the constructor. See code:



I hope I don't make matters worse...
 
Adam Richards
Ranch Hand
Posts: 135
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic