You can declare a method by following way,
<Access Specifier> <Return Type> <Method Name>(Parameter list)
{
Body
}
Example:
public int add()
return integer value
A simple HelloWorld would look like this, in C#:
namespace HelloWorld { class Program { static void Main() { System.Console.WriteLine("Hello World!"); } } }
Main itself is a method, so probably you don't want to declare more method in it. (Note: C# allows you to do that, they are called "local functions" or you can do "lambda expressions" as well.)
References: