1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
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,

    Amanda
     
  2. jcsd
  3. Sep 27, 2011 #2

    phyzguy

    User Avatar
    Science Advisor

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook