Inheritance

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

given 3 classes a, b and c, all derived from each other
class a{
protected void method()
{
//do something
}
}

class b : a{
protected void override method()
{
//do something
}
}

class c : b{
protected void override method()
{
//Is it possible to bypass the implementation in b?
// base.method() // will call b.method()
// a.method() // compiler won't allow
}
}

tnx for any help
 
<"=?Utf-8?B?QnJpYW4gS2VhdGluZyBFSTlGWEI=?=" <csharp at
briankeating.net> said:
given 3 classes a, b and c, all derived from each other
class a{
protected void method()
{
//do something
}
}

class b : a{
protected void override method()
{
//do something
}
}

class c : b{
protected void override method()
{
//Is it possible to bypass the implementation in b?
// base.method() // will call b.method()
// a.method() // compiler won't allow
}
}

No - you can only invoke "one level up".
 

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