Files
javaSE-0419/day10/src/com/inmind/interface_constatnt05/MyInterfaceConstatnt.java

12 lines
561 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.inmind.interface_constatnt05;
/*
接口中定义"成员变量",其实是一个常量,编译器会在成员属性前默认加上【public static final】!!!
final:最终,被它修饰的内容就不能更改
接口中的常量的作用:为接口的行为规范,提供配套的固定值
接口中的常量如何使用:接口名.常量名来调用
*/
public interface MyInterfaceConstatnt {
public static final int num = 10;//"成员变量"
int num1 = 20;//编译器会在成员属性前默认加上【public static final】!!!
}