Accepted answer

I'm sorry I gave the wrong answer before. I rechecked, and it didn't do quite want you want. I did find a solution for you though, again, in 3.4.

Highlight the class, do a copy CTRL-C or cut CTRL-X, click on the package you want the class do go into, and do a paste, CTRL-V. Eclipse will auto generate the class for you.

Convert Member Type to Top Level doesn't quite work. Doing that will create a field of the outer class and generate a constructor that takes the outer class as a parameter.


Can be done in 2 refactorings :

  1. Convert Member type to top level

  2. Move


Right-click the class name (in the source code) and choose Refactor -> Convert Member Type to Top Level. It doesn't let you choose the package, though.


For IntelliJ IDEA / Android Studio: Refactor -> Move -> Move inner class MyInnerClass to upper level


In Eclipse 3.6, you can do: Refactor -> Move type to new file

Related Query

More Query from same tag