I have the following code where I print the values ββbefore the method Main()is called using the static constructor. How to print a different value after returning the Main () function, without changing the methodMain()
I need a conclusion:
1st
2nd
3rd
My "base" code:
class Myclass
{
static void Main(string[] args)
{
Console.WriteLine("2nd");
}
}
I added a static constructor to Myclass to display "1st"
class Myclass
{
static Myclass() { Console.WriteLine("1st"); }
static void Main(string[] args)
{
Console.WriteLine("2nd");
}
}
Now I need to do the 3rd without changing the methodMain() . How can I do this, if at all possible?
source
share