Choose selective differences between an array in c# and array in other programming languages.

Choose selective differences between an array in c# and array in other programming languages.
A. Declaring array in C# the square bracket([]) comes after the type but not after identifier
B. It is necessary to declare size of an array with its type
C. No difference between declaration of array in c# as well as in other programming languages
D. All of the mentioned
 
Answer: a
Explanation: i. When declaring an array in C#, the square brackets ([]) come after the type, not the identifier. Brackets after the identifier are not legal syntax in C#.
example :
Code:
int[] IntegerArray;
ii. The size of the array is not part of its type as it is in the C language. This allows to declare an array and assign any array of int objects to it, regardless of the array's length.
Code:
int[] IntegerArray;
IntegerArray = new int[10];
IntegerArray = new int[50];
 

Tìm kiếm

Back
Top