ToString() überschreiben

public class Class1
{
    private string sName = "";
    private int iValue = 0;
 
    public string Name
    {
        get
        {
            return sName;
        }
        set
        {
            sName = value;
        }
    }
 
    public int Value
    {
        get
        {
            return iValue;
        }
        set
        {
            iValue = value;
        }
    }
 
    public override string ToString()
    {
        return string.Format("Name: {0}\nWert: {1}", Name, Value);
    }
}