java - keyword 'this' shown as a variable name -


i beginner in java coding , having hard time understanding below scenario. below screen shot of eclipse, while trying debug program. not understand why variables section in top right corner shows this variable name , value of this test(class name). thought pointer , not variable. , moreover, object class test not yet created. so, referencing to? if see screenshot not used in program. still while debugging shown variable name

eclipse screenshot

can me ?

from section 15.8.3 of jls:

when used primary expression, keyword this denotes value reference object instance method or default method invoked (§15.12), or object being constructed.

so can sort of regard read-only variable, basically. can same thing can other variables.

in screen-shot, execution @ start of constructor - this refers object being initialized.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -