C# Programming - Arrays - Discussion

Discussion :: Arrays - General Questions (Q.No.3)

3. 

Which one of the following statements is correct?

[A]. Array elements can be of integer type only.
[B]. The rank of an Array is the total number of elements it can contain.
[C]. The length of an Array is the number of dimensions in the Array.
[D]. The default value of numeric array elements is zero.
[E]. The Array elements are guaranteed to be sorted.

Answer: Option D

Explanation:

No answer description available for this question.

Shweta said: (Jul 25, 2014)  
Arrays index start to zero and that's why arrays default value is zero.

Gloops said: (Aug 3, 2014)  
Well when declaring intMyArr = new int[1,2].
I obtain intMyArr[1, 1] = 0.

But @Shweta, how do you verify the default value of the index ?
In the execution window, try :

? intMyArr[,]
or
? intMyArr[,0]

Syntax error ...

Hussain said: (Nov 4, 2014)  
Whenever a object is created if the object has instance variables then they are initialized to default values.

The default value for string is null and for integer is 0, so..on..

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.