SoFunction
Updated on 2025-03-07

C# Basic Introduction-Keywords

example:

using System;
using ;
using ;
namespace Test
{
 class Program
 {
  static void Main(String[]args)
  {
   ("Hello World!");
  }
 }
}

1. The keyword class, the purpose of this keyword is to declare the class, which is the smallest unit of a C# program. For example, in the above example, the class name is Program.

2. The keyword namespace , the purpose of this keyword is to declare a "namespace". For example, in the above example, the namespace is called MyApp1.

3. The keyword using, the purpose of this keyword is to import the namespace. For example, this sentence: using ; is used to import classes in the namespace.

4. Keywords static (static), void (no return value), string (string type). Often see in the declaration of Main() method: static void Main(string[] args)

5. The Main() method is a special method in C# and is the entry to the program. That is to say, if the Main() method is not available, the program cannot be started.

6. All keywords are composed of lowercase letters, and in C#, uppercase and lowercase letters are strictly distinguished.

7. Shortcut keys - F5 (for debugging); ctrl + F5 (for debugging, start directly).

8. Command to output one sentence: ("Hello World!")

The above is all the content of this article. I hope that the content of this article will help you study or work. I also hope to support me more!