CODEARTS IDE-移动内部类到上层:重构前

时间:2024-04-16 15:05:23

重构前

class OuterClass {
    String str = "test";
    public void outermethod(){
        InnerClass ic = new InnerClass();
        ic.print();
    }

    class InnerClass {
        public void print(){
            System.out.println(str);
        }
    }
}
support.huaweicloud.com/usermanual-codeartside/codeartside_01_0120.html