C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Difference between Abstract Class and Polymorphism in C#
WhatsApp
Vignesh Mani
10y
52.1
k
0
2
25
Blog
Here are the points of difference between abstract class and polymorphism:
Abstract class is a base class. Cannot create instance whether it may be base class or not. But in polymorphism, we can create instance to base class.
In abstract class, we use abstract keyword to method but in polymorphism uses virtual keyword to base class method.
In abstract class, we can declare abstract method inside abstract method and can define method which class derived abstract class.
In polymorphism, declaration and definition are only inside corresponding class.
In polymorphism, we can access derived class method through base class, but in abstract class we cannot access derived class method threw base class because cannot create an object to base class.
Abstract method declares only inside abstract class, but we can declare virtual method inside a class as well (it should be a base class).
People also reading
Membership not found