Re: Question about Abstract classes and Interfaces



imenalo@xxxxxxxxx wrote:
Could you give me a real world
example, or some type of example that shows the benefits of having an
interface as opposed to an abstract class or just regular
inheritance. I mean in all the examples I tend to see, the same thing
can be accomplished with classes.

java.util.Collection

--
Lew
.



Relevant Pages

  • Re: Concrete class
    ... >> abstract class with ALL pure virtual functions. ... >> above philosophy then it means that your Shape is an interface. ... > of doing this is to keep the inheritance hierarchy at a low depths" is ...
    (comp.lang.cpp)
  • Re: Abstract class or interface?
    ... Abstract classes require and imply inheritance whereas interfaces do not. ... An abstract class would be used wherever it was important to enforce some ... aspect of the implementation an interface is used where only the agreement ... > derived classes can only inherit one abstract class. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: A Java "interface" declaration does not allow a constructor to be specified in it ...
    ... > If Java supported full multiple inheritance (which is ... > the implication of interface constructors), ... abstract class MailDelivery has a non-abstract method "transport", ...
    (comp.lang.java.programmer)
  • Re: Confuesd about abstract class vs interface
    ... An abstract class is kind of like a new car. ... That's inheritance. ... An interface is a promise that your class will implement a set of methods ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Why I need Interface
    ... An abstract class is useful for providing some default or fundamental implementation. ... But it ties you to a specific base class, preventing you from inheriting any other base class. ... If you have no implementation you want to provide through inheritance, why lock yourself into it by using an abstract class rather than an interface? ...
    (microsoft.public.dotnet.framework)