Hello, A quick search on this forum for "interface" in the subject line will result in lots of links to discussions covering this very question. The search page link is at top right of this page. Good Luck.
Hi ls, Interfaces are also known as behavioural inheritence because when you are implementing the interface you are actaully implementing its behaviour, means that you are providing implementation to the methods provided in the interface and you have to provide implementation to all the methods of the interface. And this also a way of providing the abstract behaviour which we cannot provide through the actual inheritence by using the super classes. Interfaces are used where certain behaviour is needed by the objects but it need not necesarily be part of class, like example in AWT we have various Listener interfaces which provide fuctionality or behaviour of certain kind to all the component objects which may be needed by the component to perform some action, but they need not be part of the class. This way certain actions common to all the different kinds of objects is abstracted in interfaces and when ever they need to have that behavour they can implement and override them and provide their own behavoiur. Like in c++ we dont have multiple inheritance in Java so Interfaces help in providing kind of multiple inheritence in Java. Example the WindowListener in AWT package it is provides signature for different kinds of window operations we can have like windowclosing, windowclosed etc whichever class wants windows behavoiurs they can implement the windowListener interface and override the method they want to use in their own way. Also please go through the JLS for other techincal details Hope this helps Kareem