c#枚举数字转枚举_C#枚举能力问题和解答 套装1

c#枚举数字转枚举

1) There are following statements are given below, which of them are correct about enumeration in C#?
  1. Enumeration is used to assign the names to integral constants, which makes the program readable.

  2. It is a reference data type.

  3. Enumeration is not supported in C#

  4. It is used only in VB.NET

Options:

  1. Only A

  2. Only B

  3. C and D

  4. B and C

Answer & Explanation

Correct answer: 1
Only A

The only A statement is correct about the enumeration in C#.NET.

1)下面给出了以下语句,其中哪些对于C#中的枚举是正确的?
  1. 枚举用于将名称分配给整数常量,从而使程序可读。

  2. 它是参考数据类型。

  3. C#不支持枚举

  4. 仅在VB.NET中使用

选项:

  1. 只有一个

  2. 只有B

  3. C和D

  4. B和C

答案与解释

正确答案:1
只有一个

关于C#.NET中的枚举,唯一的A语句是正确的。

2) There are following data types are given below, which of them cannot be used as an underlying data-type in the enumeration?
  1. int

  2. short

  3. byte

  4. float

  5. double

Options:

  1. Only C

  2. A and B

  3. D and E

  4. A, B and C

Answer & Explanation

Correct answer: 3
D and E

In C#.NET, we cannot use float or double data types as an underlying data type in the enumeration.

2)下面给出了以下数据类型,其中哪些不能用作枚举中的基础数据类型?
  1. 整型

  2. 字节

  3. 浮动

选项:

  1. 只有C

  2. A和B

  3. D和E

  4. A,B和C

答案与解释

正确答案:3
D和E

在C#.NET中,我们不能将浮点或双 精度数据类型用作枚举中的基础数据类型。

3) In C#.NET, which keyword is used to create an enumeration?
  1. enumerate

  2. enumeration

  3. Enum

  4. enum

Answer & Explanation

Correct answer: 4
enum

In C#.NET, enum keyword is used to create an enumeration.

3)在C#.NET中,哪个关键字用于创建枚举?
  1. 枚举

  2. 枚举

  3. 枚举

  4. 枚举

答案与解释

正确答案:4
枚举

在C#.NET中, enum关键字用于创建枚举。

4) Can we inherit enum values in C#.NET?
  1. Yes

  2. No

Answer & Explanation

Correct answer: 2
No

No, we cannot inherit enum values in C#.NET.

4)我们可以在C#.NET中继承枚举值吗?
  1. 没有

答案与解释

正确答案:2
没有

,我们不能继承C#.NET中的枚举值。

5) In C#.NET, enum is?
  1. Reference type

  2. Value type

  3. Both types

  4. Code type

Answer & Explanation

Correct answer: 2
Value type

In C#.NET, enum is a value type.

5)在C#.NET中,枚举是?
  1. 参考类型

  2. 值类型

  3. 两种类型

  4. 代码类型

答案与解释

正确答案:2
值类型

在C#.NET中,枚举是一种值类型。

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

c#枚举数字转枚举

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值