I have been learning Java from Java 2: Complete Reference, 5th Edition. I couldn't understand the exact of purpose this
keyword and the concept of instance variable hiding. please explain me with example.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
The exact purpose of this is to remove ambiguity from local variable from your field variables.
this is an alias or a name for the current instance inside the instance. It is useful for disambiguating instance variables from locals (including parameters), but it can be used by itself to simply refer to member variables and methods, invoke other constructor overloads, or simply to refer to the instance. Some examples of applicable uses (not exhaustive):
also read this keyword and also this link