Answer: If we have an array which has no initialization of elements such as,
int[] rank = new int[10];
then now if we try to get any element with the array index like,
Console.WriteLine(rank[4]); // prints default value i.e. 0
It will call the default values of the elements.
Default value means the result of bitwise zeroing of the memory.
This process is known as
Default Element Initialization of
arrays.
Asked In: Spotted While Learning |
Alert Moderator