package com.box;
public class Box {
double width;
double height;
double depth;
//封装类成员变量
Box(Box ob){
width=ob.width;
height=ob.height;
depth=ob.depth;
System.out.println("我是传递一个对象的构造函数");
}
Box(double w,double h,double d){
width=w;
height=h;
depth=d;
System.out.println("我是有三个参数的构造函数");
}
Box(){
width=-1;
height=-1;
depth=-1;
System.out.println("admin我是无参数的构造函数");
}
Box(double len){
width=height=depth=len;
System.out.println("我是double len构造函数");
}
double volume() {
return width*height*depth;
}
}
package com.box;
public class Box {
dou