为内部 class 生成 getter 和 setter。蚀
Generate getters and setters for inner class. Eclipse
如何在 Eclipse 中为内部 class 生成 getter 和 setter?我只找到了这样的信息。这对回答我的问题没有用:that and that.
将光标置于内部 class 或相应字段上方并选择菜单
Source > Generate Getters and Setters...
或快捷方式:
Alt+Shift+S> Generate Getters and Setters...
应打开一个对话框 window,您可以在其中选择应生成哪些 Getters and/or Setters。
默认情况下,也可以只键入相应的方法名称(例如getName
)并使用自动完成Ctrl+Space 创建方法。
On Windows
将光标设置在内部 class 的任意位置并点击 Alt+Shift+S+R。 Select 您要为其生成 setters/getters 的字段。点击确定。
对外部应用相同的过程 class。
如何在 Eclipse 中为内部 class 生成 getter 和 setter?我只找到了这样的信息。这对回答我的问题没有用:that and that.
将光标置于内部 class 或相应字段上方并选择菜单
Source > Generate Getters and Setters...
或快捷方式:
Alt+Shift+S
> Generate Getters and Setters...
应打开一个对话框 window,您可以在其中选择应生成哪些 Getters and/or Setters。
默认情况下,也可以只键入相应的方法名称(例如getName
)并使用自动完成Ctrl+Space 创建方法。
On Windows
将光标设置在内部 class 的任意位置并点击 Alt+Shift+S+R。 Select 您要为其生成 setters/getters 的字段。点击确定。
对外部应用相同的过程 class。