posted 14 years ago
Please have a look at the following piece of code:
public class Point {
public int x = 0;
public int y = 0;
//constructor
public Point(int x, int y) {
this.x = x;
this.y = y;
}
}
I know that "this" keyword is used to access the current object. Here both int x=0 and int y=0 are primitive variables. So how am i able to access these variables with "this" keyword? How is that it is referring to the current object? Which is the current object here?
Please explain this