One of the problems we see from time to time is ambiguous class constructors.
public cBox() { }
public cBox(int length, int width, int height)
{
this.length = length;
this.width = width;
this.height = height;
}
public static cBox
FromLengthWidthHeight(int length, int width, int height)
{
return new cBox {
length = length, width = width, height = height };
}
cBox BigBox =
cBox.FromLengthWidthHeight(10, 10, 20);
No comments:
Post a Comment