1.1.3 understand c # program,
Using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Text;
Using System. Threading. Tasks;
Namespace HellowWorld
{
Class Program
{
Staticvoid Main (string [] args)
{
Console. WriteLine ("hellow world ");
Console. ReadLine ();
}
}
}
1. namespace keywords
Namespace is a way to organize code in c #. Similar to the package in java, you can put closely related code in the same namespace, greatly improve management and use efficiency
2. using Keyword
Use using in c # To reference other namespaces, similar to using import to import other packages in java
3. class keywords
C # is an object-oriented language like java. class keywords are used to represent classes. The written code should be included in the class, and the class should be included in the namespace. c # is different from java, the class name is not required to be the same as the class file name
4. Main Method
The Main () method in c # is the main gate of the program. The application starts to run from here, which works the same as Main () in java, but Main () in c () the initial letter must be larger.
The Main () return values of c # include void or other values, and the parameters can be optional. There are four forms.
Static void Main (){}
Static int Mian (){}
Sttic void Main (string [] args ){}
Static int Main (string [] args ){}