c# 命名空间命名规范_C#命名空间能力问题和解答 套装2

c# 命名空间命名规范

1) Can we create a nested namespace in C#.NET?
  1. Yes

  2. No

Answer & Explanation

Correct answer: 1
Yes

Yes, we can create a nested namespace in C#.NET.

1)我们可以在C#.NET中创建嵌套的名称空间吗?
  1. 没有

答案与解释

正确答案:1

是的,我们可以在C#.NET中创建一个嵌套的名称空间。

2) A namespace can contain an interface in C#.NET?
  1. Yes

  2. No

Answer & Explanation

Correct answer: 1
Yes

Yes, a namespace can contain an interface.

2)命名空间可以包含C#.NET中的接口吗?
  1. 没有

答案与解释

正确答案:1

是的,名称空间可以包含一个接口。

3) There are following statements are given below, which of them are correct about namespace in C#.NET?
  1. We cannot create a nested namespace.

  2. In C#.Net, there is no limit for nested levels for a namespace.

  3. We can create nested namespaces up to 4 levels only.

  4. To create nested namespace we need to use “using” keyword.

Options:

  1. Only A

  2. D and C

  3. Only B

  4. Only D

Answer & Explanation

Correct answer: 3
Only B

The only statement B is correct about namespace in C#.NET.

3)下面给出了以下语句,其中哪些对于C#.NET中的名称空间是正确的?
  1. 我们无法创建嵌套的名称空间。

  2. 在C#.Net中,名称空间的嵌套级别没有限制。

  3. 我们最多只能创建4个嵌套的名称空间。

  4. 要创建嵌套的名称空间,我们需要使用“ using”关键字。

选项:

  1. 只有一个

  2. D和C

  3. 只有B

  4. 只有D

答案与解释

正确答案:3
只有B

唯一的语句B关于C#.NET中的名称空间是正确的。

4) There are following statements are given below, which of them are correct about namespace in C#.NET?
  1. In C#.NET, every class belongs to a namespace.

  2. A namespace can contain either a class or a structure.

  3. All members of the namespace must be in the same file.

  4. By default name of the namespace is the project name.

Options:

  1. A and D

  2. Only B

  3. Only C

  4. B and C

Answer & Explanation

Correct answer: 1
A and D

The statements A and D are correct about namespaces.

4)下面给出了以下语句,其中哪些对于C#.NET中的名称空间是正确的?
  1. 在C#.NET中,每个类都属于一个命名空间。

  2. 命名空间可以包含类或结构。

  3. 命名空间的所有成员必须在同一文件中。

  4. 默认情况下,名称空间的名称是项目名称。

选项:

  1. A和D

  2. 只有B

  3. 只有C

  4. B和C

答案与解释

正确答案:1
A和D

语句A和D关于名称空间是正确的。

5) There are following namespaces are given below, which of them are not valid namespace of .NET Framework Class Library?
  1. Data

  2. Process

  3. Web

  4. Drawing2D

Options:

  1. Only A

  2. B and D

  3. Only C

  4. A and C

Answer & Explanation

Correct answer: 2
B and D

In the above options, B and D are not valid namespaces of FCL.

5)下面给出了以下命名空间,其中哪些不是.NET Framework类库的有效命名空间?
  1. 数据

  2. 处理

  3. 网页

  4. Drawing2D

选项:

  1. 只有一个

  2. B和D

  3. 只有C

  4. A和C

答案与解释

正确答案:2
B和D

在以上选项中,B和D不是FCL的有效名称空间。

翻译自: https://www.includehelp.com/dot-net/csharp-namespace-aptitude-questions-and-answers-2.aspx

c# 命名空间命名规范

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值