Linked Questions

845 votes
38 answers
208k views

When should I use an interface and when should I use a base class? Should it always be an interface if I don't want to actually define a base implementation of the methods? If I have a Dog and Cat ...
23 votes
3 answers
27k views

I have been getting deeper into the world of OOP, design patterns, and actionscript 3 and I am still curious how to know when to use an Abstract class (pseudo for AS3 which doesn't support Abstract ...
Brian Hodge's user avatar
  • 2,133
0 votes
1 answer
2k views

From what I understand, an abstract class provides a framework of members with no body and enables its subclasses to each implements its own members. But a class cannot inherit from more than one base ...
AlwaysLearning's user avatar
-1 votes
2 answers
596 views

Hi all i have some doubts about abstract class and interface Am not asking about difference between interface and abstract class . Am just asking about different between abstract method and interface ...
Ramesh Rajendran's user avatar
1579 votes
34 answers
827k views

I have recently had two telephone interviews where I've been asked about the differences between an Interface and an Abstract class. I have explained every aspect of them I could think of, but it ...
Houman's user avatar
  • 66.6k
113 votes
15 answers
118k views

I was asked a question, I wanted to get my answer reviewed here. Q: In which scenario it is more appropriate to extend an abstract class rather than implementing the interface(s)? A: If we are using ...
lowLatency's user avatar
  • 5,734
1 vote
5 answers
2k views

I'm trying to understand when I should use an interface vs an abstract class. I was looking at improving my MVC application design and came across this article: http://www.codeproject.com/Articles/...
Serberuss's user avatar
  • 2,397
0 votes
2 answers
1k views

I am new to c#. I got an interface that I need to implement, including this line in the interface: public abstract IEnumerable<CardData> AllCards { get; } In my implementation I have this ...
moran's user avatar
  • 1
0 votes
1 answer
476 views

I have a problem with an accessor inherited, I can't define the set method. My code : public abstract class MotherOfDragons { public abstract String DragonsName { get; } } the classes inherited :...
A.Pissicat's user avatar
  • 3,335
0 votes
1 answer
209 views

Look at this code. public abstract class Customer { public abstract void Print(); } class Program : Customer { public override void Print() { Console.WriteLine("Print Method");...
gamerdev's user avatar
1 vote
2 answers
217 views

We all know that interfaces and abstract classes are needed for many design principles, and were told to be "the best practice" of programming, both for maintenance and expansion purposes. ...
Noob002's user avatar
  • 38
-1 votes
1 answer
128 views

Taking into account the accepted answer here, the idea for general recommendations is that, where possible, favor defining classes over interfaces. Consider the following design: A base class ...
Jennifer R. Mullins's user avatar