1. Namespaces:
Usage: (1) Build: Create a namespace, such as T1, syntax format: namespace T1.
(2) Use: Use a namespace, two methods a) using a using directive, such as after building a console application in VS
b) namespace. Class Name. Method Name
Example:
Using T1;namespace consoleapplication1{ class Class1 { static void Main (string[] args) { Zhou Zhou = new Zhou (); Zhou. Example ();}}} Namespace t1{ class Zhou {public void Example () { Console.WriteLine ("Reference to Namespace"); Console.readkey ();}}}
2. Main method:
The Main method is the entry point for the program, and a C # program must contain a Main method. There can be only one main method in a C # program. And all the main methods in C # must be static.
In the Zhu Guangming video There is a new class, such as my original class only one Class1 now adds a class Class2 and the settings start from Class2, but the start point is only one and cannot be started from Class2 because the main method is not added in Class2. When you add the main method to Class2, you can set the start from Class1 or Class2. This is the main method function, that is, the program entry point.
3.
"C #"-Basic knowledge of C #