Reputation: 318
Can a derived class access it's base class's protected method with base.method()
?
Like the following:
Class A
{
Protected doThis()
}
Class B : A
{
base.doThis();
}
Upvotes: 0
Views: 4956
Reputation: 4089
That is the definition of access modifier "protected":
http://msdn.microsoft.com/en-us/library/bcd5672a(v=vs.110).aspx
http://msdn.microsoft.com/en-us/library/ba0a1yw2.aspx
Upvotes: 0
Reputation: 44288
you can just do doThis()
in a method in the class
assuming you mean this :-
class A
{
protected void doThis()
{
}
}
class B : A
{
public void MyMethod()
{
doThis();
}
}
Upvotes: 4