package com.example.test;

import com.example.domain.Box;

public class BoxTest {

	public static void main(String[] args) {

		// create objects of type Box
		Box mybox1 = new Box(10, 20, 15, "mybox1");
		Box mybox2 = new Box();
		System.out.println();

		System.out.println(mybox1);
		System.out.println(mybox2);
		System.out.println();

		System.out.println("Name: " + mybox1.getName());
		System.out.println("Width: " + mybox1.getWidth());
		System.out.println("Height: " + mybox1.getHeight());
		System.out.println("Depth: " + mybox1.getDepth());
		System.out.println();
		
		System.out.println("Before update...");
		System.out.println(mybox1);
		mybox1.updateBox(mybox1);
		System.out.println("After update...");
		System.out.println(mybox1);
		
		Box mybox4 = mybox1.getBox(20, 20, 20, "mybox4");
		System.out.println(mybox4);
		
		Box mybox5 = mybox1.getBox("mybox5", 20, 20, 20);
		System.out.println(mybox5);
		
		// access static variable from the class itself
		System.out.println("Counter: " + Box.counter);
		
		Box mybox6 = mybox1.getBox("mybox6", 30, 30);
		System.out.println(mybox6);
		
		Box mybox7 = mybox1.getBox("mybox7", 40);
		System.out.println(mybox7);

		// both objects have access to the same members
		// use dot notation to access members
//		mybox1.display();

		// use dot notation to assign values to members
//		mybox1.setDimension(10, 20, 15, "mybox1");
//		mybox1.display();

//		mybox2 = mybox1;

//		mybox2.display();

		// modify either object
//		mybox2.setDimension(12, 24, 10, "mybox2");

//		System.out.println("mybox1's volume is " + mybox1.calculateVolume());
//		System.out.println("mybox2's volume is " + mybox2.calculateVolume());
	}

}
