Java Static
-
静态变量
-
静态常量
-
静态代码块
-
静态方法
-
静态内部类
-
静态变量
public static int number;
- 静态常量
public static final int TYPE_APPLE = 0;
- 静态代码块
static {
number = 1;
}
- 静态方法
public static String getType() {
return "apple";
}
- 静态内部类
public class Dao {
private static class Tool {
private static final int number = 0;
}
}