集册 Java实例教程 使用双精度类型变量计算3D盒子的体积

使用双精度类型变量计算3D盒子的体积

欢马劈雪     最近更新时间:2020-01-02 10:19:05

498
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
使用双精度类型变量计算3D盒子的体积

public class Main {

    public static void main(String[] args) {/**来 自 时   代     Java  公  众  号 - nowjava.com**/

        double width = 0.5, height = 1.0, depth = 0.2;


        System.out.print("Volume of the box (in cubic meter):");

        System.out.println(width * height * depth);

    }

}