While understanding the basic concept of inheritance in internet, i came across a piece of code.
I've seen many people using public static void main().Why dont they simply use public void main() ??What's the advantage of using static here ?
Public class BaseClass
{
Public BaseClass ()
{
Console.WriteLine ("Base Class Constructor executed");
}
Public void Write ()
{
Console.WriteLine ("Write method in Base Class executed");
}
}
Public class ChildClass: BaseClass
{
Public ChildClass ()
{
Console.WriteLine("Child Class Constructor executed");
}
Public static void Main ()
{
ChildClass CC = new ChildClass ();
CC.Write ();
}
}