Eclipse可以在{+;enter上添加方法描述吗

Eclipse可以在{+;enter上添加方法描述吗,eclipse,Eclipse,如何让Eclipse在方法定义上自动添加方法描述块 如果我写:public int test(int hello){ 然后按“回车”。 Eclipse将在下面两行添加结束括号,因此代码的结尾如下: public int test(int hello){ } /** * @param hello * @return */ public int test(int hello){ } 如果在光标位于方法名称中时按ctrl+shift+j,代码将如下所示: public int test(

如何让Eclipse在方法定义上自动添加方法描述块

如果我写:
public int test(int hello){

然后按“回车”。 Eclipse将在下面两行添加结束括号,因此代码的结尾如下:

public int test(int hello){

}
/**
 * @param hello
 * @return
 */
public int test(int hello){

}
如果在光标位于方法名称中时按ctrl+shift+j,代码将如下所示:

public int test(int hello){

}
/**
 * @param hello
 * @return
 */
public int test(int hello){

}

现在我的问题是:是否可以让Eclipse添加方法描述(在ctrl+shift+j上添加的内容)当我创建方法时,会自动执行?同时创建结束括号。

您提到的方法描述在技术上称为Javadoc comment。在Eclipse-Windows->Preferences->General->Keys中有命令列表和绑定到这些命令的键。您可以根据自己的喜好更改键

但是,我想要的是在方法创建时添加Javadoc。就像创建了结束括号一样。您是否尝试将“添加Javadoc注释”命令的键更改为Enter键?是否有效?是的,然后在按Enter键时无法获得新行。