Arrays

Q1: If a is an array of 5 integers then which of the following is the correct way to increase its size to 10 elements?

A
int[] a = new int[5]; 
int[] a = new int[10];

B
int[] a = new int[5]; 
a.Length = 10 ;

C
int[] a = new int[5]; 
a.Length = 10 ;

D
int[] a = new int[5]; 
a = new int[10];

E
int[] a = new int[5]; 
a.GetUpperBound(10);

ANS:D -

int[] a = new int[5]; 
a = new int[10];

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.