programming-examples/c-sharp/Functions/C# Program to Implement Static Method.cs
2019-11-15 12:59:38 +01:00

35 lines
651 B
C#

/*
* C# Program to Implement Static Method
*/
using System;
class Program
{
static void stamethod()
{
Console.WriteLine("Static Method");
}
void MethodB()
{
Console.WriteLine("Instance Method");
}
static char stamethod2()
{
Console.WriteLine("Static Method");
return 'C';
}
static void Main()
{
Program.stamethod();
Console.WriteLine(Program.stamethod2());
Program programInstance = new Program();
programInstance.MethodB();
Console.Read();
}
}
/*
Static Method
Static Method
C
Instance Method