in interview i faced one question
why abstract when interface ?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Afzaal Ahmad ZeeshanRank #60 · 27.6K reputationPosted Oct 18, 2016, 8:17 AM EDT
Note that an abstract class is still a class, but it cannot be instantiated (you cannot do, "new Class()"). Whereas an interface defines the basic structure of a service, for example in ASP.NET, we have IService and that is used by EmailService, SmsService and they have one function in common. They will define their own behavior, either send using SMTP or use an SMS gateway.
For more on this, please read this thread: http://stackoverflow.com/questions/761194/interface-vs-abstract-class-general-oo
prabhu p172 reputationPosted Oct 18, 2016, 9:26 AM EDT