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
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started