4 Replies - 1782 Views - Last Post: 31 March 2009 - 02:53 AM Rate Topic: -----

#1 jee  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 20-February 09

Can you tell me the difference between interface and abstract interfac

Posted 28 March 2009 - 11:30 PM

Can you tell me the difference between interface with abstract interface ? thank u !

Please take care ! abstract interface is not abstract class !

This post has been edited by jee: 29 March 2009 - 12:34 AM

Is This A Good Question/Topic? 0
  • +

Replies To: Can you tell me the difference between interface and abstract interfac

#2 kanchan  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 12-August 07

Re: Can you tell me the difference between interface and abstract interfac

Posted 28 March 2009 - 11:34 PM

An interface allows somebody to start from scratch to implement your interface or implement your interface in some other code whose original or primary purpose was quite different from your interface. To them, your interface is only incidental, something that have to add on to the their code to be able to use your package.

An abstract class, in contrast, provides more structure. It usually defines some default implementations and provides some tools useful for a full implementation. The catch is, code using it must use your class as the base. That may be highly inconvenient if the other programmers wanting to use your package have already developed their own class hierarchy independently. In Java, a class can inherit from only one base class.
Was This Post Helpful? 0
  • +
  • -

#3 jee  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 20-February 09

Re: Can you tell me the difference between interface and abstract interfac

Posted 29 March 2009 - 12:32 AM

View Postkanchan, on 28 Mar, 2009 - 10:34 PM, said:

An interface allows somebody to start from scratch to implement your interface or implement your interface in some other code whose original or primary purpose was quite different from your interface. To them, your interface is only incidental, something that have to add on to the their code to be able to use your package.

An abstract class, in contrast, provides more structure. It usually defines some default implementations and provides some tools useful for a full implementation. The catch is, code using it must use your class as the base. That may be highly inconvenient if the other programmers wanting to use your package have already developed their own class hierarchy independently. In Java, a class can inherit from only one base class.


Sorry ! I want to know interface and abstract interface difference or not interface and abstract class . :)
Was This Post Helpful? 0
  • +
  • -

#4 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4188
  • View blog
  • Posts: 11,852
  • Joined: 18-April 07

Re: Can you tell me the difference between interface and abstract interfac

Posted 29 March 2009 - 12:58 AM

Interfaces are already abstract. Remember the key term "abstract" as it relates to OOP means that you can't create an instance of itself, you can only use it as a base class from which you can derive your own objects from it.

Interfaces by their very nature are abstract in that they don't define any code themselves, but must be implemented by classes which then provide the functionality of the methods in the interface.

So you can add the word "abstract" to the front of an interface and nothing will happen any differently. Even in the java documentation awhile back the writers made an error by including "abstract" in the wording for interfaces.

But you just need to know that all interfaces are abstract and there is no difference. :)
Was This Post Helpful? 1
  • +
  • -

#5 jee  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 20-February 09

Re: Can you tell me the difference between interface and abstract interfac

Posted 31 March 2009 - 02:53 AM

Thanks for Martyr2 help !
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1