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

inheriting from a base class and using an interface

P: n/a
I have a class which is implementing an interface, but I also want to have
it inherit from a base class. Can you do both with a class? If so, what's
the syntax?

thanks.
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
public class NewClass : theBase, theInterface
{
//code
}
"Mark" <ma*****@kc.rr.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
: I have a class which is implementing an interface, but I also want
to have
: it inherit from a base class. Can you do both with a class? If so,
what's
: the syntax?
:
: thanks.
:
:
Nov 13 '05 #2

P: n/a

Awesome. thanks!
"Chris Barrell" <no@spam.com> wrote in message
news:OK****************@tk2msftngp13.phx.gbl...
public class NewClass : theBase, theInterface
{
//code
}
"Mark" <ma*****@kc.rr.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
: I have a class which is implementing an interface, but I also want
to have
: it inherit from a base class. Can you do both with a class? If so,
what's
: the syntax?
:
: thanks.
:
:

Nov 13 '05 #3

P: n/a
Mark,
In addition to Chris's example, you can actually implement multiple
interfaces, but inherit from only one base class.

public class NewClass : theBase, theFirstInterface, theSecondInterface
{
//code
}

Hope this helps
Jay

"Mark" <ma*****@kc.rr.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I have a class which is implementing an interface, but I also want to have
it inherit from a base class. Can you do both with a class? If so, what's
the syntax?

thanks.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.