using System;
publicclass Temperature
{
private decimal temp;
public Temperature(decimal temperature)
{
this.temp = temperature;
}
public override string ToString()
{
return this.temp.ToString("N1") + " C";
}
}
publicclass Example
{
publicstaticvoid Main()
{
Temperature currentTemperature = new Temperature(23.6m);
Console.WriteLine("The current temperature is {0}.", currentTemperature);
}
}