提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
使用双精度类型变量计算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); } }