java基础 接口常量

 1 /**
 2  * 接口当中也可以定义"成员变量", 但是必须使用public static final三个关键字进行修饰
 3  * 从效果上看,这其实就是接口的【常用】
 4  * 格式:
 5  * public static final 数据类型 常量名称=数据值;
 6  * 
 7  * 接口当中的常量,可以省略public static final.
 8  */
 9 public interface MyInterfaceConst {
10 
11     public static final int num = 1;
12 }

猜你喜欢

转载自www.cnblogs.com/mantishell/p/11774427.html