Let’s say I have a base class “base” and three classes that inherit it “A”, “B”, and “C”. Class A needs access to method1, and method2. Class b needs access to method2, and method3. Class c needs access to method3 and method4. Should all of these methods be defined in the base Class? It seems wrong for each derived class to have access to methods that they do not need. Is there a better solution that I’m not thinking of?
I tried putting all methods in the base class.
Andrew Sims is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
4