View Single Post
  #4 (permalink)  
Old January 11th, 2006, 04:26 PM
chafor chafor is offline
Authorized User
 
Join Date: Dec 2005
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have taken this exemple directly from MSDN:

public static class TemperatureConverter
{
    public static double CelsiusToFahrenheit(string temperatureCelsius)
    {
        // Convert argument to double for calculations.
        double celsius = System.Double.Parse(temperatureCelsius);

        // Convert Celsius to Fahrenheit.
        double fahrenheit = (celsius * 9 / 5) + 32;

        return fahrenheit;
    }

    public static double FahrenheitToCelsius(string temperatureFahrenheit)
    {
        // Convert argument to double for calculations.
        double fahrenheit = System.Double.Parse(temperatureFahrenheit);

        // Convert Fahrenheit to Celsius.
        double celsius = (fahrenheit - 32) * 5 / 9;

        return celsius;
    }
}

Why can they maked the class static? Is it because it's in ASP.NET2.0?

And I fogot;) Thanks