+ 4
Can someone please explain the concept of 'this' pointer??
3 Answers
+ 2
class Box
{
Double width, height, depth;
Box (double w, double h, double d)
{
this.width = w;
this.height = h;
this.depth = d;
}
}
For example here this.w refers to the variable width, the argument passed while calling the constructor for a current object.
More you can find here http://www.studytonight.com/java/this-keyword-in-java.php
0
http://en.cppreference.com/w/cpp/language/this