Re: interfaces

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



abcd wrote:
Can someone tell me whats the exact advantage of Interfaces in C#. To me abstract classes serves the purpose and have all good things then what is special about interfaces...can someone tell me some real example from system, user, developer point of view....

You can implement many interfaces in a class but only have one single base-class.

Also an interface doesn't force you to make the methods virtual/override.

Additionally all methods for an interface have to be public.
.



Relevant Pages

  • Re: My recent Epiphany about operating systems
    ... In Winblow$, the release & bundling of IE was purposely as crippleware, ... & bug delivery system 2 trap people into constantly 'upgrading'. ... Also there's the fact that OS's are driven by customers and marketing, not necessarily purpose. ... If he doesn't like the interface of a free operating system, ...
    (freebsd-questions)
  • Re: Subclasses in interfaces
    ... the "basic purpose" of an interface was a reuse of the phrase from Chris ... I said the basic purpose of the interface was contradicted ... I'm also against it for the sole reason of the unqualified access issue. ...
    (comp.lang.java.programmer)
  • Re: lists in cx_Oracle
    ... the driver would have to manipulate the SQL ... If that was so then it could be solved at the driver level pretty ... use the aformentioned "class for this purpose". ... It sounds like you're saying that the interface is actually implemented ...
    (comp.lang.python)
  • Re: Subclasses in interfaces
    ... > violates the purpose of an interface. ... an objects interface is the description of the ... /how/ java should be used in proper design. ... The JLS talks about classes, but you cannot find in the JLS about proper OO ...
    (comp.lang.java.programmer)
  • Re: dynamic type checking - a pauline conversion?
    ... >> interface (other than using reflection, ... Anyway, for my purpose, *any* implementation of close would suffice. ... but if I see an adaptor that maps the ... then I know that a programmer knew enough about the MyClosable ...
    (comp.object)