Home > Net >  C # the difference between two kind of contractual relationship
C # the difference between two kind of contractual relationship

Time:09-26

Virtual + orverride and abstract + override two kind of contractual relationship, what is the difference between them,















CodePudding user response:

Virtual refers to: can override
Abstract: must override

CodePudding user response:

At the il level, the abstract will automatically mark virtual

CodePudding user response:

The default implementation, no default implementation

CodePudding user response:

In simple terms, it is the difference between the abstract and virtual,
The abstract is not achieved,
Virtual have implemented

CodePudding user response:

Virtual can not rewrite orverride, also use the parent class, subclass need their functionality can be orverride
The abstract must be orverride not IDE complains
  •  Tags:  
  • C#
  • Related