Vishal Hegde wrote:Is it by default?
If I understand you correctly, it is optional in certain situations. For example, if you have a class-level field called "foo", you can access this field in a method with or without using "this", so it's optional.
However, if you also have a variable in your method with the same name, you must use "this" in order to refer to the class-level field.
You see this sort of thing a lot in setter methods, where the method parameter usually has the same name as the field.