What are Methods?
A method (or function) is a block of code which only runs when it is called. You can pass data, known as parameters, into a method.
Syntax:
csharp static void MyMethod() { Console.WriteLine("Executing method..."); }
Calling a Method:
Inside Main:
csharp
MyMethod();
voidmeans the method doesn't return a value.staticmeans it belongs to the class, not a specific object.