开发者

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

开发者 https://www.devze.com 2022-12-31 03:19 出处:网络
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 Refacto

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

精彩评论

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