In C# all methods must be declared inside a class. However, if you declare a method or field as static, you can call the method or access the fields by using the name of the lass. No instance is required.

class RFClass
    {
        public static double converter(double inp1)
        {
            return inp1 * 3;
        }
    }

dedigin zaman, main fonksiyon icindeyken asagidaki komut calisiyor;
 double d2 = RFClass.converter(423);



Creating a Shared Field in a class
-- Objenin icindeki variable a field denir

When defining a field, you can use the static keyword so the field becomes available to all methods in an object, hence becoming shared field.


Creating a static field with const Keyword
When you define a field with const keyword, it automatically becomes static - available to all methods or outside calls- but can not be changed since it's defined as a constant. You can only define int, double or string as a constant



Static Class
In order to use as a utility class, hold variables and call methods, you can also define a static class.



Ama sadece class'i static olarak define edip de field lari static olarak tanimlamazsak onlar otomatikman statik olmuyorlar.. Yani

    public static class StaticClass1
    {
        public int dem = 0;
        public double demd = 0.0412;
    }

dedigimizde, dem veya demd disardan accessible static variable lar olarak islemiyor.