This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Which of the following can be used to access the third element in an array?
myArray[3].
myArray[3]
myArray[2].
myArray[2]
myArray{3}.
myArray{3}
Which of the following choices describes the correct way to create a new integer array with three elements?
int[] myArray = new int[3];.
int[] myArray = new int[3];
int[] myArray = new int[2];.
int[] myArray = new int[2];
int myArray = new int[3];.
int myArray = new int[3];
Which of the following foreach statements is syntactically correct?
foreach
foreach (int value in values).
foreach (int value in values)
foreach (int value of values).
foreach (int value of values)
foreach (int value with values).
foreach (int value with values)
You must answer all questions before checking your work.
Was this page helpful?