
public class Box {

	// instance variables
	double width;
	double height;
	double depth;
	String name;

	public Box() {
		System.out.println("Box constructor executed...");
		width = 10;
		height = 10;
		depth = 10;
		name = "box";
	}
	
	// parameterized constructor
	public Box(double width, double height, double depth, String name) {
		System.out.println("Box constructor executed...");
		this.width = width;
		this.height = height;
		this.depth = depth;
		this.name = name;
	}

	public double calculateVolume() {
		// calculate volume for box
		return width * height * depth;
	}

	public void display() {
		System.out.println("Width = " + width);
		System.out.println("Height = " + height);
		System.out.println("Depth = " + depth);
		System.out.println("Name = " + name);
		System.out.println();
	}

	// method that takes parameters
	public void setDimension(double width, double height, double depth, String name) {
		this.width = width;
		this.height = height;
		this.depth = depth;
		this.name = name;
	}
}
