Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

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 :
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.
int[] IntegerArray;
IntegerArray = new int[10];
IntegerArray = new int[50];

Join The Discussion