71
What will be the Correct statement in the following C# code?
class sample
{
protected int index;
public sample()
{
index = 0;
}
}
class sample 1: sample
{
public void add()
{
index += 1;
}
}
class Program
{
static void Main(string[] args)
{
sample 1 z = new sample 1();
z . add();
}
} Answer & Solution
Answer: Option
D
No explanation is given for this question. Let's Discuss on Board