static keyword in c sharp code example
Example 1: static c#
(static) >> means that the method belongs to the Program class
and not an 'object' of the Program class.
Example 2: what is using static in c#
using System;
using static System.Math;
public class Circle
{
public Circle(double radius)
{
Radius = radius;
}
public double Radius { get; set; }
public double Diameter
{
get { return 2 * Radius; }
}
public double Circumference
{
get { return 2 * Radius * PI; }
}
public double Area
{
get { return PI * Pow(Radius, 2); }
}
}