C# Programming - Arrays - Discussion
Discussion Forum : Arrays - General Questions (Q.No. 3)
3.
Which one of the following statements is correct?
Discussion:
4 comments Page 1 of 1.
Veerabhushan Konthanoor said:
5 years ago
Explain the answer in detail.
Hussain said:
1 decade ago
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..
The default value for string is null and for integer is 0, so..on..
Gloops said:
1 decade ago
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 ...
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 ...
Shweta said:
1 decade ago
Arrays index start to zero and that's why arrays default value is zero.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers