numberdemo.java
来自「Eclipse程序设计经典教程+源代码 学习java的朋友可以看看」· Java 代码 · 共 27 行
JAVA
27 行
package number;
public class NumberDemo {
public static void main(String[] args) {
double d1 = 775.33;
//应用数字创建数字类
Double double1 = new Double(d1);
//应用字符串创建数字类
Double double2 = new Double("775.33");
//显示最大值
System.out.println("Double.MAX_VALUE=" + double1.MAX_VALUE);
//显示最小值
System.out.println("Double.MIN_VALUE=" + double1.MIN_VALUE);
byte byteType = double1.byteValue();
int intType = double1.intValue();
long longType = double1.longValue();
float floatType = double1.floatValue();
double doubleType = double1.doubleValue();
System.out.println("double1.byteValue() = " + byteType);
System.out.println("double1.intValue() = " + intType);
System.out.println("double1.longValue() = " + longType);
System.out.println("double1.floatValue() = " + floatType);
System.out.println("double1.doubleValue() = " + doubleType);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?