当前位置:网站首页>C getting started series (XXVI) -- assemblies and namespaces
C getting started series (XXVI) -- assemblies and namespaces
2022-07-22 01:54:00 【InfoQ】
Assembly
Namespace
namespace Namespace name
{
Namespace members
}
- The namespace name can be any valid identifier ;
- Generally, the company name is used as the beginning of the namespace name , The company name is followed by the technical name ;
- Do not name a namespace the same as a class or type .
// form 1
namespace Namespace name 1
{
Namespace 1 Members of
namespace Namespace name 2{
Namespace 2 Members of
}
}
// form 2
namespace Namespace name 1
{
Namespace 1 Members of
}
namespace Namespace name 1. Namespace name 2
{
Namespace 2 Members of
}
using Several uses of
- using Instructions : Introduce namespace :
using System;
using System.Collections;
- using static Instructions : Specifies the type whose static members can be accessed without specifying a type name
using static System.Math; // Use it directly System.Math.PI
double pai = PI;
- names
using Project = PC.MyCompany.Project;
- using sentence : Bind instance to code
using (Book b1 = new Book("aaa", 15.0f),
b2= new Font("bbb", 20.0f))
{
// Use b1 and b2
}
边栏推荐
- Local storage software system of local area network for data acquisition of electric meters in Enterprises
- English语法_指示代词 this / these / that / those
- 群晖7.1.0万兆网络实测
- 分组背包问题
- TableWidget 排序的多种方式
- Leetcode 48旋转图像(水平+主对角线)、Leetcode 221最大正方形(动态规划dp表示以ij为右下角的答案值)、Leetcode 240搜索二维矩阵II(排除行列法)
- C#入门系列(二十六) -- 程序集和命名空间
- TinyMCE removes the P tag added by default in the editor line feed
- SQL164 2021年11月每天新用户的次日留存率
- 二维费用的背包问题(01背包)
猜你喜欢
[Pengcheng cup 2022] baby_ re
m在ISE平台下使用verilog开发基于FPGA的GMSK调制器
[深度学习学习笔记]注意力机制-Attentional mechanism
What is deep cloning, shallow cloning? (detailed explanation of the case)
Idea running @test cannot be input from the console and is in the loading state
网络安全和数据安全分不清?数据安全为何重要?
c#利用resx manager 切换中英文
CRM concept: understand the concepts of leads, prospect, MQL and SQL
父子进程、僵尸进程和孤儿进程
Pix2Seq:谷歌大脑提出 CV 任务统一接口!
随机推荐
【着色器实现Television信号三原色闪烁效果_Shader效果第五篇】
Est - ce que cela signifie que le binlog de MySQL est activé?
Aruba学习笔记03-Web UI --Monitoring面板介绍
The Linux server installed the graphical interface, but failed to display the initialization graphical interface when installing the database
Framework API在线查看源码
NepCTF2022 WP
Strict location dependent optimization of dynamic recursion
美国经济持续疲弱,微软冻结招聘:云业务和安全软件部门成重灾区
When Lenovo Xiaoxin Air13 Pro reinstalls win10, the storage device driver cannot be found
Learning path PHP -- thinkphp5 + windows server to achieve scheduled tasks
机器学习岗位面试总结:简历应该关注的5个重点
Does this mean that MySQL's binlog has been turned on?
谷歌展示 Chrome 浏览器图标废案,曾打算做成小火箭
一文深入浅出理解国产开源木兰许可系列协议
动态规划多重背包——庆功会(一维)
Dynamic rules - array compression optimization
二维费用的背包问题(01背包)
HCIP前期总结
LeetCode 146:LRU 缓存
Reprint: can bus terminal resistance