+ 1

What is the use of THIS keyword in java

15th Feb 2018, 5:48 PM
VEERESH KAVALI
4 Answers
+ 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