hi
say i wanna write a constructor that would pass parameters (of a simple type) to an object
say the parameters are (double)x y and z and the object is a Point3D object that has _x, _y and _z as attributes
should i use a method like setX() to pass the parameters to the object or should is use the object's constructor and pass these parameters to the constructor?
in other words should i:
public Box3D (double length, double width, double height, double x, double y, double z){ //_basicCorner is an object.
_length = length;
_width = width;
_height = height;
_basicCorner = new Point3D (x,y,z);
or should i:
public Box3D (double length, double width, double height, double x, double y, double z){
_length = length;
_width = width;
_height = height;
_basicCorner.setX(x);
_basicCorner.setY(y);
_basicCorner.setZ(z);
thanks in advance and hope i made myself clear despite english not being my native language.