abstract method

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I have class1 and class2. When I inherit from class1 or class2, I want to
have to implement a method called MyMethod(). If this was my only
requirement, I'd make MyMethod and abstract method in both class1 and
class2.

However, class2 also needs to inherit from class1. Hence, class2 has to
have some implementation of MyMethod(). I believe I won't be able to make
it abstract in class2 since it's supposed to implement all abstract methods
from Class1.

What's the best way to go about this?

Thanks in advance.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top