Getters/setters in Java

后端 未结 7 1842
轻奢々
轻奢々 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 13:58

    Sadly, no, there isn't the equivalent language-level support in java.

    The get* and set* patterns though are so established in java culture that you'll find strong IDE support for them (e.g., eclipse will make them for you automatically), and if you're working in something that uses the expression language first made for jsps (EL), then you'll be able to use the property notation to access getters and setters.

提交回复
热议问题