Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • How about if your programming language of choice does not support interfaces? I seem to recall this is the case for C++. Commented Jul 21, 2011 at 15:48
  • 7
    @Bernard: in C++, an abstract class is an interface in all but name. That they can also do more than 'pure' interfaces is not a disadvantage. Commented Jul 21, 2011 at 15:51
  • @gbjbaanb: I suppose. I don't recall using them as interfaces, but rather to provide default implementations. Commented Jul 21, 2011 at 16:01
  • Interfaces are the "currency" of object references. Generally speaking they are the fundament of polymorphic behavior. Abstract classes serve a different purpose that deadalnix explained perfectly. Commented Jul 21, 2011 at 16:56
  • 4
    Isn't this like saying "are modes of transport obsolete now we have cars?" Yeah, most of the time, you use a car. But whether you ever need anything other than a car or not, it wouldn't really be correct to say "I don't need to use modes of transport". An interface is much the same as an abstract class without any implementation, and with a special name, no? Commented Jul 22, 2011 at 9:11