c++ ##_##_C#数组能力问题和解答 套装1

c++ ##_##

1) There are following statements are given below, which of them are correct about arrays in C#.NET?
  1. Arrays are not available in C#.NET

  2. An array is a group of similar data elements.

  3. We can create an array for integers, doubles, bytes, strings, etc.

  4. In C#.Net, Array is a predefined class.

Options:

  1. Only A

  2. Only B

  3. B, C, and D

  4. Only C

Answer & Explanation

Correct answer: 3
B, C, and D

B, C and D are correct about arrays in C#.

1)下面给出了以下语句,其中哪些对于C#.NET中的数组是正确的?
  1. 数组在C#.NET中不可用

  2. 数组是一组相似的数据元素。

  3. 我们可以为整数,双精度数,字节,字符串等创建一个数组。

  4. 在C#.Net中,数组是预定义的类。

选项:

  1. 只有一个

  2. 只有B

  3. B,C和D

  4. 只有C

答案与解释

正确答案:3
B,C和D

B,C和D关于C#中的数组是正确的。

2) Is it possible to create an array of objects?
  1. Yes

  2. No

Answer & Explanation

Correct answer: 1
Yes

Yes, we can create an array of objects in C#.NET.

2)是否可以创建对象数组?
  1. 没有

答案与解释

正确答案:1

是的 ,我们可以在C#.NET中创建对象数组。

3) What is the correct way to declare and initialize an array of characters with 4 elements?
  1. char []ch = { 'A', 'C', 'D', 'E'};

  2. char ch[] = { 'A', 'C', 'D', 'E'};

  3. char ch{} = { 'A', 'C', 'D', 'E'};

  4. char ()ch = { 'A', 'C', 'D', 'E'};

Options:

  1. A

  2. B

  3. C

  4. D

Answer & Explanation

Correct answer: 1
A

char []ch = { 'A', 'C', 'D', 'E'}; is the correct way to declare and initialize an array of characters.

3)声明和初始化具有4个元素的字符数组的正确方法是什么?
  1. char [] ch = {'A','C','D','E'};

  2. char ch [] = {'A','C','D','E'};

  3. char ch {} = {'A','C','D','E'};

  4. char()ch = {'A','C','D','E'};

选项:

  1. 一个

  2. C

  3. d

答案与解释

正确答案:1
一个

char [] ch = {'A','C','D','E'}; 是声明和初始化字符数组的正确方法。

4) There are following statements are given below, which of them are correct about given code snippet in C#.NET?
    int []arr = {5,0,10,20,4};

  1. It is not a proper way to create an array.

  2. Here we are creating an array of 5 integer elements.

  3. Here arr is a reference to the array created on the stack.

  4. We need to use curly braces to create an array in C#.NET.

Options:

  1. Only A

  2. Only B

  3. C and D

  4. A and D

Answer & Explanation

Correct answer: 2
Only B

Only B is the correct statement about given code snippets.

4)下面给出了以下语句,这些语句对于C#.NET中的给定代码段是正确的?
  1. 这不是创建数组的正确方法。

  2. 在这里,我们创建了一个由5个整数元素组成的数组。

  3. 这里arr是对在堆栈上创建的数组的引用。

  4. 我们需要使用花括号在C#.NET中创建一个数组。

选项:

  1. 只有一个

  2. 只有B

  3. C和D

  4. A和D

答案与解释

正确答案:2
只有B

关于给定的代码段,只有B是正确的语句。

5) Can we create a jagged array in C#.NET?
  1. Yes

  2. No

Answer & Explanation

Correct answer: 1
Yes

Yes, we create a jagged array in C#.NET, in jagged array row size may differ from each other in the matrix.

5)我们可以在C#.NET中创建锯齿状数组吗?
  1. 没有

答案与解释

正确答案:1

是的 ,我们在C#.NET中创建了一个锯齿状数组,锯齿状数组的行大小在矩阵中可能彼此不同。

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

c++ ##_##

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值