+ 4

Can someone please explain the concept of 'this' pointer??

21st Oct 2017, 3:58 AM
Saransh Bhatia
Saransh Bhatia - avatar
3 Answers
21st Oct 2017, 5:28 AM
Nanda Balakrishnan
+ 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
12th Nov 2017, 5:15 PM
Anahit Harutyunyan
Anahit Harutyunyan - avatar
0
http://en.cppreference.com/w/cpp/language/this
21st Oct 2017, 6:53 AM
Yuri Lyagin
Yuri Lyagin - avatar