正文

Java中定义常量的方法:使用`final`关键字声明变量,并初始化。例如:`public static final int MAX_VALUE = 100;` 这样定义的常量,其值在类加载时就已确定,不能被修改。