By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,892 Members | 1,111 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,892 IT Pros & Developers. It's quick & easy.

override non-static method with a static one

P: n/a
Joe
I have a base class with all abstract methods. I need to inherit from this
base class but the new class will have all static methods. Is there a way to
do this?

I tried using new but then it complains that the base method hasn't been
implemented.

Thanks,
Joe
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Joe <J_no_spam@_no_spam_Fishinbrain.com> wrote:
I have a base class with all abstract methods. I need to inherit from this
base class but the new class will have all static methods. Is there a way to
do this?


No. You could override the abstract method with something which just
calls a static method though.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2

P: n/a
Abstract base classes are just like interfces, so if u derive from it ,
first u should do is to implement all virtual functions of abstract class.

Then u can use the these virtual functions by creating an instance of your
new class, if u want to use the static methods, just call them using the
your class (no need to use new-no need to create an instance-)
Nov 16 '05 #3

P: n/a
Joe
I already have one class that implements the base class. This other class is
a static wrapper to call the implementation class. The implementation is
actually a remote object. Now you're probably wondering why do this all over
again instead of just using code generated from soapsuds. Well the reason is
because I need to do some additional work before making the actual call to
the server.

I'll mess around and report back on how I ended up.

Thanks,
Joe

"Coder" <oa***@st.cs.deu.edu.tr> wrote in message
news:u3**************@tk2msftngp13.phx.gbl...
Abstract base classes are just like interfces, so if u derive from it ,
first u should do is to implement all virtual functions of abstract class.

Then u can use the these virtual functions by creating an instance of your
new class, if u want to use the static methods, just call them using the
your class (no need to use new-no need to create an instance-)

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.