Can a partial class inherit from a partial class?

  • Thread starter Thread starter bradw2k
  • Start date Start date
B

bradw2k

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
 
bradw2k said:
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
 
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.
 

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