编写一个盒子类Box的Java程序?
classBox{privatedoublelength;privatedoublewidth;privatedoubleheight;publicBox(){if(lenght<0||width<0||height<0){System.out.println("输入值不合法!");}System.out.println("盒子体积是:"+length*height*width);}}
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州京杭网络科技有限公司 版权所有