Question: ALL THE QUESTIONS ARE C# BASED 1) Select the correct array declaration int arr[] = {2, 3, 4, 9, 33}; int[] arr = [2, 3,

ALL THE QUESTIONS ARE C# BASED

1) Select the correct array declaration

int arr[] = {2, 3, 4, 9, 33};

int[] arr = [2, 3, 4, 9, 33];

int[] arr = {2, 3, 4, 9, 33};

int arr[] = {2, 3, 4, 9, 33};

2) What is the index of the first element of an array?

-1

0

1

None of the above

3) Using exception handling, which block contains the code that might throw an exception?

if

try

catch

finally

4) A foreach statement can iterate through what type of object?

array

collection

string

Both A and B

5) What is the proper method declaration for passing an array of strings by reference?

public static void UpdateString(string[] array)

public static void UpdateString(ref string array)

public static void UpdateString(string array)

public static void UpdateString(ref string[] array)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!