I want to know what is exactly a method header and what is a method signature and is this the same among programming languages or just in C#?
So, is it correct to say the following is a method header:
public void SumNumbers(int firstNumber, int secondNumber)
and the following is the method signature:
public void SumNumbers(int, int)
?
Best Answer
According to the C# spec, a method header consists of:
So to extend what you've shown:
Above example contains examples of the possible parts that make up a method header, while the minimum (all non-optional parts) would be something like:
As for the signature, see 3.6 Signatures and overloading:
So the signature of your second example would be:
See also Method Signature in C# on SO, especially Eric Lippert's answer.