+ 1

this

This is something I've been struggeling to understand. The "this" keyword. Where do you use it? And how?

5th Jul 2016, 5:03 AM
Andreas BeEm Kvist
Andreas BeEm Kvist - avatar
4 Answers
+ 1
That explanation did not really help me much. But I know how to use it and how it works now. http://www.sololearn.com/app/csharp/playground/cW5gpQvxwekl/ If I am correct, it allows you to create new variables with the same name as another, but you use this.variable to use the one inside the class.
5th Jul 2016, 10:55 AM
Andreas BeEm Kvist
Andreas BeEm Kvist - avatar
+ 1
it means use the variable of the class not the method
14th Oct 2016, 8:42 AM
Oussama Abbas
Oussama Abbas - avatar
0
It reffers to the current instance of the class.
5th Jul 2016, 8:55 AM
Dino Knezevic
Dino Knezevic - avatar
0
That.
6th Jul 2016, 7:46 AM
Kami
Kami - avatar