定义常量

public class Demon09 {
//定义常量static修饰符,不分先后顺序。
static final double Pi = 3.14;

public static void main(String[] args) {
System.out.println(Pi);
}
}
输出:

3.14

Process finished with exit code 0

posted @ 2021-08-18 21:28  小风扇呜呜呜  阅读(39)  评论(0)    收藏  举报