0

Is it possible to inherit from a base class, which inherits from another base class?

7
  • Yes that's possible of course. Commented Apr 27, 2011 at 2:13
  • 1
    And of course you tried it before you posted? Commented Apr 27, 2011 at 2:13
  • yes i tried it, but i got an error " Error 8 Inconsistent accessibility: base class 'commercial' is less accessible than class Commented Apr 27, 2011 at 2:15
  • You typically see that message when the base class is private - it is therefore "less accessible" Commented Apr 27, 2011 at 2:18
  • and you made sure all classes are equally accessible (all public for example)? Do a search for ".net class access modifiers" and be amazed! Commented Apr 27, 2011 at 2:18

4 Answers 4

1

Yes, inheritance goes as deeply as you want.

Sign up to request clarification or add additional context in comments.

Comments

1

You already have the answer provided in the question you asked before: c-abstract-classes.

I am not going to rewrite that code but if it's not perfect and it's give you errors then you need to do some debugging. Often times, people write code here that isn't 100% error free.

You need to run that code that was given to you and ask a SPECIFIC question about a SPECIFIC error. Post what you have tried and what you are trying to do along with your code.

Comments

0

Yes, it is! Look here. You know, there's a lot of reading you should do. Possibilities are exciting!

If you show us the code you are trying, maybe you would get more help.

Comments

0

Yes, you can only inherit from one class, but that class may inherit from another.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.