Which of the following statements is correct about the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class Sample
{
public int index;
public int[] arr = new int[10];
public void fun(int i, int val)
{
arr[i] = val;
}
}
class MyProgram
{
static void Main(string[] args)
{
Sample s = new Sample();
s.index = 20;
Sample.fun(1, 5);
s.fun(1, 5);
}
}
}
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Mock TestView All Free Test