我想限制受保护方法对某些继承类的访问.
例如,有一个基类
TBase = Class
Protected
Method1;
Method2;
Method3;
Method4;
End;
Run Code Online (Sandbox Code Playgroud)
我有两个派生自TBase的课程
TDerived1 = Class(TBase)
//Here i must access only Method1,Method2 and Method3
End;
TDerived2 = Class(TBase)
//Here i must access only Method3 and Method4
End;
Run Code Online (Sandbox Code Playgroud)
那么是否有可能只访问方法1,方法2和方法3时,我使用的对象TDerived1和 方法3方法4和当我使用的对象TDerived2