Learning a language usually starts from the "Hello World" program. below is the C # version:
Using System;
Class Hello {
Static void Main (){
Console. WriteLine ("Hello World !");
}
}
The "Hello World" program starts with the using command and references the System namespace ).
The namespace provides hierarchical organization of C # programs and class libraries. The namespace contains types and other namespaces. For example, the System namespace contains several types, such as the Console class referenced in the program, and several other namespaces, such as IO and Collections. If you reference a given namespace using the using command, you can use the namespace members unlimitedly. It is because the using command is used that System. Console. WriteLine can be abbreviated as Console. WriteLine.
The Hello class declared in the "Hello World" program has only one member, that is, the method named Main. The Main method is declared with the static modifier. The static method is different from the instance method. The latter uses the keyword "this" to reference a specific object instance. The operation of the static method does not need to reference a specific object. As a convention, the static method of the named Main acts as the entry to the program.
Program output is generated by the WriteLine method of the Console class in the System namespace. This class is provided by the. NET Framework class library. By default, the class library is automatically referenced by the Microsoft C # compiler. Note that C # does not have a separate runtime class library. In fact, the. NET Framework is the C # runtime class library.
This article from the "CSharp development topics" blog, please be sure to keep this source http://cssoffer.blog.51cto.com/7059827/1242388