I
I
Ivan Petrov2017-06-25 00:40:45
Java
Ivan Petrov, 2017-06-25 00:40:45

What is the difference between var and this.var in java?

I recently started learning java.
Tell me what is the difference between class properties with and without this . For example, there is a var
property . It can be used as just var , or as this.var . What is the difference? just var belongs to the class and this.var to the specific object?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Romanov, 2017-06-25
@Djaler

var can point to a local variable var created in this function. Or on the argument of this function. And this.var always points to the property

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question