+ 3

Can anyone explain this operator plzzz....

with the help of a program

11th Oct 2017, 3:52 PM
Anuraj Garhwal
2 odpowiedzi
+ 14
The this keyword is used inside the class and refers to the current instance of the class, meaning it refers to the current object. One of the common uses of this is to distinguish class members from other data, such as local or formal parameters of a method, as shown in the following example: class Person { private String name; public Person(String name) { this.name = name; } } Here, this.name represents the member of the class, whereas name represents the parameter of the constructor. Another common use of this is for passing the current instance to a method as parameter: ShowPersonInfo(this);
11th Oct 2017, 4:04 PM
Vukan
Vukan - avatar
0
OK... Thanks man
12th Oct 2017, 10:21 AM
Anuraj Garhwal