开发者

How do I convert a method's local variable or expression to a method parameter using Eclipse?

How do I convert a method's local vari开发者_Go百科able or expression into a method parameter using Eclipse's built-in refactoring tools?


You can use the "Introduce Parameter" option on the Refactor.. submenu when you right-click.

You'll need to select an expression, such as the expression used to initialise the local variable, for this to work.


If you remove the declaration of your local variable, the places you used that variable will no longer compile. You can then choose "Add parameter" from the quick fix menu (Ctrl-1 I think, don't have Eclipse open now).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜