What is the output of the following code snippet?

class Student
{
public static int counter = 0;
public string Name { get; set; }
static Student()
{
counter += 1;
}
public Student(string name)
{
Name = name;
}
}


class Program
{
static void Main(string[] args)
{
Student obj1 = new Student("Stella");
Student obj2 = new Student("Jack");
Student obj3 = new Student("Suzzane");
Console.WriteLine(Student.counter);
}
}

3
1
0
2
Verified Answer
Correct Option - b

To get all Infosys Certified CSharp Programmer Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram