numberdemo.java~21~

来自「jbuilder2006一书的所有源代码」· JAVA~21~ 代码 · 共 28 行

JAVA~21~
28
字号
package number;

public class NumberDemo {
  public static void main(String[] args) {
    double d1 = 55.23;
    //应用数字创建数字类
    Double double1 = new Double(d1);
    //应用字符串创建数字类
    Double double2 = new Double("55.23");
    //显示最大值
    System.out.println("Double.MAX_VALUE=" + double1.MAX_VALUE);
    //显示最小值
    System.out.println("Double.MIN_VALUE=" + double1.MIN_VALUE);

    System.out.println("以下返回byte1变量的各种类型:");
    Double 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 + -
显示快捷键?