Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

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

  1. Sep 27, 2011 #1
    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,

  2. jcsd
  3. Sep 27, 2011 #2


    User Avatar
    Science Advisor

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook