What does it mean when an abstract class is virtual

T

tony

Hello!!

I know what an abstract class is which mean that the one of the derived
class must define
the abstract methods in the abstract class. So all the abstract methods in
the abstarct class must be defined by some derived class.

What does it mean when an abstract class is virtual?

//Tony
 
J

Jon Skeet [C# MVP]

tony said:
I know what an abstract class is which mean that the one of the derived
class must define
the abstract methods in the abstract class. So all the abstract methods in
the abstarct class must be defined by some derived class.

What does it mean when an abstract class is virtual?

Classes can't be declared as "virtual". I assume you've seen this
somewhere in an example - could you give that example?

Jon
 
G

Guest

Both abstract and virtual classes have to be inherited from.

Abstract (or pure virtual) classes are classes that contain no
functionality. They really just define an interface that child classes have
to implement.

Virutal classes contain a mix of concrete functionality and abstract methods
that have to be implemented in child classes.

Note that these are O-O design concepts and have no effect on you C# code
where everything is just declared as abstract (or not).
 

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

Top