Getters/setters in Java

后端 未结 7 1821
轻奢々
轻奢々 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:55

    Nope. AS3 getters and setters are an ECMAScript thing. In Java, you're stuck with the getVal() and setVal() style functions--there isn't any syntactic sugar to make things easy for you.

    I think Eclipse can help auto-generating those types of things though...

提交回复
热议问题