Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

C Sharp Programming

If a is an array of 5 integers then which of the following is the correct way to increase its size to 10 elements?

Question: If a is an array of 5 integers then which of the following is the correct way to increase its size to 10 elements?
[A].

int[] a = new int[5];
int[] a = new int[10];

[B].

int[] a = int[5];
int[] a = int[10];

[C].

int[] a = new int[5];
a.Length = 10 ;

[D].

int[] a = new int[5];
a = new int[10];

Answer: Option D

Explanation:

No answer description available for this question.

If a is an array of 5 integers then which of the following is the correct way to increase its size to 10 elements? Read More »

Arrays, C Sharp Programming

Which of the following statements is correct about the array declaration given below?

Question: Which of the following statements is correct about the array declaration given below?

[A].

intMyArr refers to a 2-D jagged array containing 2 rows.

[B].

intMyArr refers to a 2-D jagged array containing 3 rows.

[C].

intMyArr refers to a 3-D jagged array containing 2 2-D jagged arrays.

[D].

intMyArr refers to a 3-D jagged array containing three 2-D jagged arrays.

Answer: Option C

Explanation:

No answer description available for this question.

Which of the following statements is correct about the array declaration given below? Read More »

Arrays, C Sharp Programming

Which of the following statements is correct about the C#.NET code snippet given below?

Question: Which of the following statements is correct about the C#.NET code snippet given below?

[A].

intMyArr is a reference to an object of System.Array Class.

[B].

intMyArr is a reference to an object of a class that the compiler derives from System.Array Class.

[C].

intMyArr is a reference to an array of integers.

[D].

intMyArr is a reference to an object created on the stack.

Answer: Option B

Explanation:

No answer description available for this question.

Which of the following statements is correct about the C#.NET code snippet given below? Read More »

Arrays, C Sharp Programming