Syntax to define a class in C Sharp
Syntax to define a class in C#
-
Modifiers or some special keywords that we can use on class optionally like public, static, internal ,sealed, abstract, partial etc.
-
Class is a keyword which we use for defining our class very similar to the Struct keyword we use for defining the structure.
-
Name refers to the name of class which is user define and can have any name.
Syntax to define main method under the class
-
In java and C# language main method must be declared Static if at all we want to start the execution from here with the help of class Instance.
-
Main is the name of Method which can not be change and must be in proper case.
-
While defining the main method if required we can pass parameter to the main method but of type String array only.
Happy learning!!
ReplyDelete