Getters/setters in Java

后端 未结 7 1849
轻奢々
轻奢々 2021-02-18 13:18

I\'m new to Java, but have some OOP experience with ActionScript 3, so I\'m trying to migrate relying on stuff I know.

In ActionScript 3 you can create getters and sette

7条回答
  •  一整个雨季
    2021-02-18 14:08

    Also before adding setters and getters, it might be a good idea to ask yourself why are you exposing the internal data of the Object in question.
    I suggests you read this article - http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html

提交回复
热议问题