+ 1

What is the use of THIS keyword in java

15th Feb 2018, 5:48 PM
VEERESH KAVALI
4 ответов
+ 14
It's used to refer to the object you are working with.
15th Feb 2018, 9:31 PM
Alex Shaw 😻
Alex Shaw 😻 - avatar
+ 11
You're welcome!! ^-^/
28th Feb 2018, 6:16 PM
Alex Shaw 😻
Alex Shaw 😻 - avatar
+ 2
It references the current object in context. ::::EXAMPLE:::: class MyClass { private String name = ""; public void setName(String name) { this.name = name; } } ^In that example, "this.name" is referencing the name of this particular instance of the class.
15th Feb 2018, 6:00 PM
Fata1 Err0r
Fata1 Err0r - avatar
+ 1
thanks alex
28th Feb 2018, 5:44 PM
VEERESH KAVALI