C# language feature:
applies to
benefit
static
methods that cannot be instantiated.how to use
static
modifier.example:
public static class Static_Class_Circle_Example
{
public static double AreaFromRadius(double radius)
{
return 3.14*radius*radius;
}
}
public class Use_of_Static_Class_Example
{
public void use_static_class_method(){
// no need to declare and instantiate a variable of Static_Class_Circle_Example
System.Console.WriteLine(Static_Class_Circle_Example.AreaFromRadius(5));
}
}