简体   繁体   中英

How to move static method in eclipse to different class

I've got a public static method in class A: A.myMethod() . Now I want to move it to class B. I don't do that by cut and paste because then all calls won't work anymore. So I want to make use of eclipse's refactoring engine. As I read here I go to my method and open the refacotring move dialogue there. It askes me to enter a destiantion type for my method. I'm not sure what to enter there. Can you help me?

Destination Type for method is the class to where you want to move the method.

For you destination type would be Class B. This dialog also has a browse button, in which you can search for B and select it.

If you are not sure what happens, create a test method in Class A and then use the above method to move it to Class B.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM