Generic classes in C#

class Size<T> {
    public T Width { getset; }
    public T Height { getset; }

    public Size(T width, T height) {
        Width = width;
        Height = height;
    }

    public string AsText() {
        return String.Format("[{0}{1}]", Width, Height);
    }
}

var sizeInt = new Size<int>(5, 8);
var textInt = sizeInt.AsText();
//textInt is "[5; 8]"

var sizeFloat = new Size<float>(3.7f, 1.58f);
var textFloat = sizeFloat.AsText();
//textFloat is "[3.7; 1.58]"