Does Java have the equivalent of @synthesize in Objective-C?

夙愿已清 提交于 2019-12-02 06:34:07

问题


I am learning Obj-C and discovered the @synthesize directive which generates accessor and mutator methods.

Groovy auto-generates getters/setters but I'm not sure if Java does. Does Java have a similar feature in Java 7?


回答1:


As everyone has said, the answer is no, however Project Lombok could be of interest




回答2:


No, java does not come with such a feature.




回答3:


No, if I'm not mistaken, not yet at least.




回答4:


Though Java does not, to my knowledge, have such a feature defined, several Java coding environments (such as Eclipse) produce automatic getters and setters under certain circumstances.



来源:https://stackoverflow.com/questions/7956979/does-java-have-the-equivalent-of-synthesize-in-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!