全站数据
8 4 2 0 5 8 1

定义一个盒子类box,包括三个私有变量

自考成考的胡老师 | 简单学习,快乐成才!         
问题更新日期:2024-10-12 08:01:00

问题描述

定义一个盒子类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