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

Can a partial class inherit from a partial class?

P: n/a
In 2.0, can a partial class inherit from a partial class to override a
virtual method? I do not have VS2005 installed to test, I'm just
trying to plan with respect to upgrading to 2.0 later.

If it is not possible in 2.0, is it planned for later C#? I'm just
curious here.

Thanks,
Brad Williams

Sep 28 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a


"bradw2k" <br*****@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
In 2.0, can a partial class inherit from a partial class to override a
virtual method? I do not have VS2005 installed to test, I'm just
trying to plan with respect to upgrading to 2.0 later.

Sure. A partial class just instructs the compiler to look through all the
source files to piece together the definition of the class. Once it's
compiled, it's no different from any other class.

David

Sep 28 '06 #2

P: n/a
"bradw2k" <br*****@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
In 2.0, can a partial class inherit from a partial class to override a
virtual method?
Yes.
Sep 28 '06 #3

P: n/a
Brad,

There is no such thing as a partial class. A class is a class, nothing
more, nothing less.

The partial keyword allows you to break up the definition of a class
across multiple files.

To answer what I think you are asking, yes, if you use the partial
keyword to break up your class definition, you can still derive from a base
class.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"bradw2k" <br*****@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
In 2.0, can a partial class inherit from a partial class to override a
virtual method? I do not have VS2005 installed to test, I'm just
trying to plan with respect to upgrading to 2.0 later.

If it is not possible in 2.0, is it planned for later C#? I'm just
curious here.

Thanks,
Brad Williams

Sep 28 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.