3 Tier Inheritance

  • Thread starter Thread starter zmigliozzi
  • Start date Start date
Z

zmigliozzi

I have a Super class (class1), a sub-class (class2), and then a sub-
class of the sub-class (class3).

In Class3 would the syntax for using inheritance be

class Class3 : Class2 : Class1

or

class Class3 : Class2
*since Class2 will already inherit Class1. Is that right?*

Thanks for the help.
 
I have a Super class (class1), a sub-class (class2), and then a sub-
class of the sub-class (class3).

In Class3 would the syntax for using inheritance be

class Class3 : Class2 : Class1

or

class Class3 : Class2
*since Class2 will already inherit Class1. Is that right?*

Thanks for the help.

So you would have Class2 : Class1, right? Then all you need in class3
is Class3 : Class2 since Class2 already inherits Class1.
 
I have a Super class (class1), a sub-class (class2), and then a sub-
class of the sub-class (class3).

In Class3 would the syntax for using inheritance be

class Class3 : Class2 : Class1

or

class Class3 : Class2
*since Class2 will already inherit Class1. Is that right?*

The second is correct. The first won't compile.
 

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