Say I have a class1 that derives from abstract class2. Class2 has an abstract method that each derived class must override. In my design the method will only be called if class1 is casted to class2. Is there a way to hide this method when it is casted as class1? Not really a problem for me if not just wondering. If it is possible is this a good/bad idea and why? Thanks!!!
Share
You could use explicit interface implementation to achieve a similar effect. To call an explicitly implemented interface method you need to cast to the interface.