About Main method
We can Declare Main method four types in C sharp.1. public static void Main()
2. public static void Main(string [] args ) or public static void Main(string args [])
3. static void Main()
4. static int main()
We cant declare Main method without static keyword.
we can make more than 1 Main method in c sharp.
Main method declaration
public static void Main()
here
'public' is access specifier.
'static' is keyword.
'void' is a return type.
'Main' is a method.
In c sharp Main() method is a entry point of Program.
without making a Main method we cant run our program.
No comments:
Post a Comment