zhuguowei
zhuguowei

Reputation: 8487

How to move inner class to outer

There is an inner class , e.g.

public class Foo {
    public static void main(String[] args) {
    }

    @Data
    public static class Award {
        private final int id;
        private final String name;
    }
}

I want to move Award out of Foo, can Intellij IDEA support it? I tried selecting the code then choose Move menu of Refactor menu. But it hints enter image description here

Upvotes: 6

Views: 2930

Answers (1)

arghtype
arghtype

Reputation: 4534

There is no need in selecting entire class, just click on class name and call Refactor - Move (F6 hotkey). Something like this will happen:

enter image description here

Upvotes: 16

Related Questions