Restrict Function Calls in Child Class
I have a base class Base, and derived classes from it such as DerivedA, DerivedB etc. And I have task classes derived from android.os.AsyncTask such as TaskA, Task B, TaskC etc.
What I want to accomplish is restricting calls in Task classe开发者_高级运维s to specific Derived classes. Such as
TaskA can call functions from DerivedA, but not from DerivedB,DerivedC etc ...
Every class can call public
methods. You could restrict access by putting your classes in separate packages and use package-private access. See here if you don't know it already.
精彩评论