© { JSL }
76
Text Box: throw
throw
Folded Corner:
·you can throw any object you like
was long as it's derived from System.Exception
class Matrix
{  
    public Matrix(int rowSize, int colSize)
    {
        ...
    }
    public Row this [ int index ]
    {       
        get { BoundsCheck(index); ... }
        set { BoundsCheck(index); ... }
    }
    // validation
    private void BoundsCheck(int index)
    {
        if (index < 0 || index >= rows.Length)
            throw new IndexOutOfRangeException();
    }
    // representation
    private Row[] rows;
}
don't forget the new