Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Difference between Abstract Class and Polymorphism in C#
WhatsApp
Vignesh Mani
9y
51.5
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).
abstract class
C#
polymorphism
Up Next
Class, Inheritance And Abstract Class With Real Time Examples In C#
Ebook Download
View all
Programming Strings using C#
Read by 23.4k people
Download Now!
Learn
View all
Membership not found