⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 numberdemo.java~17~

📁 jbuilder2006一书的所有源代码
💻 JAVA~17~
字号:
package number;

public class NumberDemo {
  public static void main(String[] args) {
    double d1 = 55.23;
    //应用数字创建数字类
    Double double1 = new Double(d1);
    //应用字符串创建数字类
    Double double2 = new Double("100");

    System.out.println("数字类的常用属性:");
    System.out.println("以下显示Byte型整数类最大值与最小值:");
    //显示Byte型整数类最大值
    System.out.println("Double.MAX_VALUE=" + double1.MAX_VALUE);
    //显示Byte型整数类最小值
    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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -