Why I need Interface

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



My query is why I need an Interface, since my abstract class does the same
functionality

Interface
No implementation of methods - ------- This can achieved by abstract class
No instance creation just inheriting ----- This can achieved by abstract class

I know using interface we can go multiple inheritance
I am looking in such way the in terms of OOPS in C# what is the significance

Also I know there are certain places (WWF, WCF) only interface allows as
contracts, those things are MS design part.
I am looking why I need interface, if Abstract class does every thing

Thanks & Regards
Umeshnath


.



Relevant Pages

  • Re: When would you use an abstract class and when an interface?
    ... An abstract class is useful when you need a substantial amount of ... An example of where an interface is useful is where you have unrelated ... items that need to provide some similar functionality in a uniform ... but where the system caches them to disc as well as HTML ...
    (comp.lang.php)
  • Re: Abstract Class
    ... I don't know if I understand, but, If your customer has an Abstract class ... come from the interface implementation plus any additional functionality you ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Multiple inheritance examples?
    ... Java programmers actually use multiple inheritance more often than they are aware of. ... Basically, there is an idiom which is used in the Swing framework, but also elsewhere, where an API is presented in three entities: An interface that defines the API as such, an abstract class implementing that interface which provides template methods for easy subclassing, and a default implementation derived from that abstract class that can just be instantiated to get the behavior you 'usually' want. ... This largely doesn't exist in CLOS. ...
    (comp.lang.lisp)
  • Re: Declaring a Constructor in an Interface?
    ... i have read many places that an interface is faster than ... but would You also claim that an abstract class ... Dennis JD Myrén ... > Virtual methods always means performance overhead. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Java/J2EE Openings in RTP, NC
    ... JSP, EJB, DAO Developer ... An abstract class is declared with the keyword "class" and is an implementation, i.e., its methods can contain bodies. ... An interface is a declaration of public method signatures which taken together represent a type with a defined contract for interaction with other types. ... A "Type 1" JDBC driver is a bridge to an ODBC driver which in turn interacts with the data store. ...
    (comp.lang.java.programmer)