determining which verb to use for method names in Java

后端 未结 7 2135
半阙折子戏
半阙折子戏 2021-01-30 23:02

I understand that naming conventions are important for a number of reasons, most having to do with making your code more readable and easier to integrate into larger projects, e

7条回答
  •  无人及你
    2021-01-30 23:11

    Regarding the use of get and set methods for property accessors only: the whole point of information hiding is that the user of an API (i.e. the calling code) should not need to know or depend on whether the property is stored or calculated on the fly. The implementation should be able to change at any time, as long as the API stays the same.

提交回复
热议问题