For example, should I use:
public Line(Vector dorigin, Vector ddir)
{
origin = dorigin.clone();
dir = ddir.clone();
}
instead of:
public Line(Vector dorigin, Vector ddir)
{
origin = dorigin;
dir = ddir;
}
???
So, suppose I have a program like this: Line[] line = new Line[10];
for (i = 0; i < n; i++)
{
Vector temp = new Vector(i, 0);
line[i] = new Line(temp, temp);
}
//and then operate on the array line
then I should use the first constructor?