接口中方法、常量的定义

接口中方法、常量的定义

  • 接口中方法的默认为 public

  • 接口中的属性默认修饰为 public static final。在idea开发工具中可以看到有 Remove unnecessary 'public static final'

    public interface InterfaceTest {
      public final static int age = 99;//int age = 99 默认即为 public final static int age = 99
    }
posted @ 2021-03-02 22:45  做给谁听  阅读(271)  评论(0)    收藏  举报