Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
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 Interface
WhatsApp
Lokesh Kumar
8y
9
k
0
3
25
Blog
Abstract Class
Abstract class provides a set of rules to implement next class
Rules will be provided through abstract methods
Abstract method does not contain any definition
While inheriting abstract class all abstract methods must be override
If a class contains at least one abstract method then it must be declared as an “Abstract Class”
Abstract classes can be instantiated, but a reference cannot be created
Reference depends on child class object’s memory
Abstract classes are also called as “Partial abstract classes”
Partial abstract class may contain functions with body and functions without body
If a class contains all functions without body then it is called as “Fully Abstract Class” (Interface)
Interface
If a class contains all abstract methods then that class is known as “Interface”
Interfaces support like multiple inheritance
In interface all methods r public abstract by default
Interfaces r implementable
Interfaces cannot be instantiated, but a reference can be created
Abstract Vs Interface
Abstract class
Interface
Up Next
Difference Between Abstract Class and Interface Class
Ebook Download
View all
FileInfo in C#
Read by 16.7k people
Download Now!
Learn
View all
Membership not found