Skip to content

Commit

Permalink
doc: Update cs.md (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeng-qh committed May 8, 2023
1 parent 6f45968 commit f3ebc46
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/cs.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@ $ dotnet run
Hello, world!
```

### 命名空间
```C#
//使用时 using 命名名称
using Test;
//创建:
namespace Test{
class Test_className{
//main方法是程序的主入口
public void Myclass(){
console.writeline("Test")
}
}
}
```

### 访问修饰符
| 声明的可访问性 | 含义 |
|-----|----------------------|
| public | 访问不受限制 |
| protected | 访问限于包含类或派生自包含类的类型 (该类内部和继承类中可以访问) |
| internal | 访问限于当前程序集 |
| protected internal | 访问限于当前程序集或派生自包含类的类型 |
| private | 访问限于包含类 |
| private protected | 访问限于包含类或当前程序集中派生自包含类的类型,自 C# 7.2 之后可用 |

### 变量

```cs
Expand Down

0 comments on commit f3ebc46

Please sign in to comment.