The constructor used to copy the value from another object of the same class is called as copy constructor. It takes only a reference, not value. What you have passed is value.
Change the definition to:
Box (Box &obj) {
this.width = obj.width;
this.height = obj.height;
}
Your declaration implies that the object is passed by value. It is a copy of the object. To get a copy 'copy constructor' is called. So this will result in an infinite loop. So in C++ you can only pass by reference in case of copy constructor.
Java uses pass by reference always for non-primitive data type. So you don't have a problem.