Java在Objective-C中与@synthesize相当吗? [英] Does Java have the equivalent of @synthesize in Objective-C?

查看:116
本文介绍了Java在Objective-C中与@synthesize相当吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Obj-C,并发现了 @synthesize 指令,它可以生成访问器和mutator方法。

Groovy自动生成getters / setters,但我不确定Java是否会。 Java在Java 7中有类似的功能吗?

解决方案

正如大家所说,答案是否定的,然而龙目岛项目可能很有意义


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?

解决方案

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

这篇关于Java在Objective-C中与@synthesize相当吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆