In Java, why do people prepend fields with `this`?

前端 未结 16 2140
广开言路
广开言路 2020-12-20 11:18

When referencing class variables, why do people prepend it with this? I\'m not talking about the case when this is used to disambiguate from method

16条回答
  •  天涯浪人
    2020-12-20 11:48

    I most often see people do this because it triggers the intellisense. I personally prefer to leave off the "this." because it creates more code without any value.

提交回复
热议问题