定義一個盒子類box?
public class Box{ private double width; private double length; private double height; public Box(double width, double length, double height){ this.width = width; this.length = length; this.height = height; } public void showBox(){ System.out.printf("width=%f; length=%f; height=%f", width, length, height); } }