I have the below scenario:
public class T1
{
protected virtual int add()
{
return 1;
}
}
public class T2 : T1
{
}
public class T3 : T2
{
protected override int add()
{
return 3;
}
}
class Program
{
static void Main(string[] args)
{
T1 t1 = new T3();
((T3)t1).add();
}
}
however, in the line that call to add function ((T3)t1).add(); i am get error T3.add() is inaccessible due to its protection level