No, only use this
when you have a name conflict such as when a method parameter has the same name as an instance field that it is setting.
It can be used at other times, but many of us feel that it simply adds unnecessary verbiage to the code.
More Related Contents:
- java StackOverflowError when local and instance objects creation
- Why can't we declare variables in if statement?
- java – Explanation on “this” statement [duplicate]
- What is the meaning of “this” in Java?
- When should I use “this” in a class?
- Error: ‘else’ without ‘if’
- Java leaking this in constructor [duplicate]
- In Java, are enum types inside a class static?
- Leaking this in constructor warning
- Spring Java Config: how do you create a prototype-scoped @Bean with runtime arguments?
- Declaring and initializing variables within Java switches
- What is the difference between a local variable, an instance field, an input parameter, and a class field?
- Java, “Variable name” cannot be resolved to a variable
- What exactly is an instance in Java?
- Can we create an object of an interface?
- How do I create a static local variable in Java?
- Why is assignment to ‘this’ not allowed in java?
- What do curly braces in Java mean by themselves?
- Problems with local variable scope. How to solve it?
- Accessing a static variable via an object reference in Java
- Java: Class.this
- Advantage of Local Classes Java
- Access “this” from Java anonymous class
- Why can we use ‘this’ as an instance method parameter?
- What is the default scope of a method in Java?
- Why can’t variables be declared in an if statement?
- Polymorphism with instance variables [duplicate]
- Java local variable visibility in anonymous inner classes – why is ‘final’ keyword required?
- What is the difference between @ApplicationScoped and @Singleton scopes in CDI?
- How can I access a private constructor of a class?