Can someone please explain? As well as give a short and simple example. Thanks!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
thisis a reference to the current object, and is implicitly passed into non static methods.this.xdereferences the reference to get to the “x” attribute.Use it if you want to disambiguate between a function argument and a class member.
It is valid but redundant in this scenario:
Or simply: