CODEARTS IDE-使方法静态:重构后

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

重构后

class Outer {
   public String message;
   public static void main(String[] args) {

   }

   static class Inner {
      private Outer outer;
      private String message;

      public Inner(Outer outer, String message) {
         this.outer = outer;
         this.message = message;
      }

      public void print() {
         System.out.println(message);
      }
   }
}
support.huaweicloud.com/usermanual-codeartside/codeartside_01_0146.html