定义一个公有double型常量PI,哪一条语句最好?( )
A: public final double PI;
B: public final static double PI=3.14;
C: public final static double PI;
D: public static double PI=3.14;
A: public final double PI;
B: public final static double PI=3.14;
C: public final static double PI;
D: public static double PI=3.14;
举一反三
- 定义一个公有 double 型常量 PI,哪一条语句最好? A: public double PI; B: public static double PI; C: public final static double PI=3.14; D: public final static double PI;
- 定义一个公有 double 型常量 PI,哪一条语句最好? A: public double PI; B: public static double PI; C: public final static double PI=3.14; D: public final static double PI;
- 定义一个公有double型常量PI为3.14,下列正确的是: A: public double PI=3.14; B: public final static double PI=3.14; C: public final static double PI; D: public final double PI=3.14;
- 定义一个公有double型符号常量PI,下面的语句中正确的是()。 A: public final double PI; B: public final static double PI=3.14159; C: public final static double PI; D: public static double PI=3.14159;
- 2、以下常量申明语句,正确的是()。 A: final PI = 3.14; B: final int PI = 3.14; C: final double PI = 3.14; D: double PI = 3.14;