In programming language, there are terms called method and function. But in C# we use the term "Method."
Method is a body where we put the logic to get some work done.
Here is the list of Method type in C#.
- Pure virtual method.
- Virtual method.
- Abstract method.
- Partial method.
- Extension method.
- Instance method.
- Static method.
Pure Virtual Method
Pure virtual method is the term that programmers use in C++. There is a term "abstract" in place of "pure virtual method" in C#.
Example:
- public void abstract DoSomething();
Virtual method makes some default functionality. In other words, virtual methods are being implemented in the base class and can be overridden in the derived class.
Example:
- public class A
- {
- public virtual int Calculate(int a, int b)
- {
- return a + b;
- }
- }
- public class B: A
- {
- public override int Calculate(int a, int b)
- {
- return a + b + 1;
- }
- }
Abstract Method is the method with no implementation and is implicitly virtual. You can make abstract method only in Abstract class.
Example:
- public void abstract DoSomething(int a);
A partial method has its signature defined in one part of a partial type, and its implementation defined in another part of the type.
Example:
- namespace PM
- {
- partial class A
- {
- partial void OnSomethingHappened(string s);
- }
- // This part can be in a separate file.
- partial class A
- {
- // Comment out this method and the program
- // will still compile.
- partial void OnSomethingHappened(String s)
- {
- Console.WriteLine("Something happened: {0}", s);
- }
- }
- }
Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type.
Extension methods are used to add some functionality to given type.

Hamza HamzaouiPosted Mar 13, 2020, 6:25 PM
For Uppercase the first letter in the string it will crash if we have a space in the first letter so you should drop the first space from the string using data.Substring(1) and after that you can do your instructions.
Vinay SharmaPosted Jan 22, 2020, 3:58 PM
Good Explanation, Thanks
Ramzanali MominPosted Sep 27, 2018, 11:47 PM
Nice article
Rahul SharmaPosted Oct 18, 2016, 5:49 AM
Nice article
Manav PandyaPosted Oct 8, 2016, 8:20 AM
Great post ma'm ...
SubashPosted Jul 6, 2016, 3:01 AM
Thanks deeksha
Santhakumar MunuswamyPosted Jun 25, 2016, 1:08 AM
Nice share
Samir BhogaytaPosted Jun 23, 2016, 10:53 PM
Very nice explanation for beginners as well as experienced developers
Deeksha PanditPosted Jun 21, 2016, 11:35 AM
Thank you all
Divyanshu SinghPosted Jun 20, 2016, 2:26 PM
Great article
Del WoodcockPosted Jun 20, 2016, 10:47 AM
Great information
Vignesh ManiPosted Jun 19, 2016, 12:50 PM
Good one. Thanks for sharing