PC Review


Reply
Thread Tools Rate Thread

How to call an ancestor base class method ?

 
 
cadilhac@gmail.com
Guest
Posts: n/a
 
      7th Jan 2005
Hi,

I have a class C derived from B which is derived from A.
In an overriden method of C, I would like to call the same base method
but in A.
Using the keyword "base" performs the call in B but hoz can I call the
method in A ? Is there a language construct for this ?
Thank you

Herve

 
Reply With Quote
 
 
 
 
Richard Blewett [DevelopMentor]
Guest
Posts: n/a
 
      7th Jan 2005
If B has overridden the method then there is no way for C to invoke A's version directly

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi,

I have a class C derived from B which is derived from A.
In an overriden method of C, I would like to call the same base method
but in A.
Using the keyword "base" performs the call in B but hoz can I call the
method in A ? Is there a language construct for this ?
Thank you

Herve

 
Reply With Quote
 
Paul E Collins
Guest
Posts: n/a
 
      7th Jan 2005
<(E-Mail Removed)> wrote:

> I have a class C derived from B which is derived from A.
> In an overriden method of C, I would like to call the same
> base method but in A.
> Using the keyword "base" performs the call in B but hoz
> can I call the method in A ?


Add a method to B that calls the method in A.
C is derived from B, not A, so it does not really know about A.

P.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make sure this.Test() call base class method in base class constructor Ryan Liu Microsoft C# .NET 2 27th Aug 2006 07:43 PM
Best way to call inherited method with var of base class? =?Utf-8?B?UGhpbGlwIFdhcm5lcg==?= Microsoft VB .NET 6 16th Nov 2004 05:40 AM
Re: how to NOT call a virtual method from base class n! Microsoft C# .NET 0 28th Feb 2004 08:33 PM
How to use the base keyword to call a base class method (not a constructor) Bob Rock Microsoft C# .NET 1 26th Aug 2003 01:27 PM
How to call a base class's base class method Bill Menees Microsoft C# .NET 1 23rd Jul 2003 02:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:57 PM.