In C# the method Main must be in a nongeneric type in order to be selected as entry point. Why is that?
I'm a little bit confused about that because that is possible in Java (the function main() can be in a generic class).
namespace ConsoleApplication
{
class Program<T> //incorrect
{
static void Main(string[] args)
{
}
}
}
The
Main
method serves as a fixed interface to the operating system, which itself has no mechanism to select and specify a type to be given as a parameter.