lavankannan
Answered On : Oct 5th, 2005
The interface is just declared,so that u can use the methods were ever u want.the definition of the methods is given smewhere.it is easy to call the methods only with the method name.the method name refers and takes the declaration parts.
Login to rate this answer.
As By giving the Methods(Declaring) in Interface , We are telling to must follow exactly the same Signature for the given Methods. This wil be used when we are writing RMI Applications . Because in this case we just give the Interface to the User, so that user will come to know the Signature of the Method and later he/she will call it.
Login to rate this answer.
interfaces are meant for abstraction of data ie only method declarations are provided so that any class implementing the interface it will give the specific implementation according to the requirements.we must place only methods for which the implementation is user specific and not known at the time of designing the interface.
Login to rate this answer.
In interfaces we implement the reusability& polymorphism concept. Each class that implements the interface is going to define the same method in its own way based on its conditions. with interfaces we can support dynamic method resolution at runtime .
Login to rate this answer.
RK
Answered On : Apr 23rd, 2007
Interfaces are like Contract/Agreement that defines the precedure that we have to follow. When the class implements an interface, it guarantees that it has implemented the methods of the interface.
Login to rate this answer.
Anyclassfrom anyinheritence tree canimplementthe interface methods by its own way.
Login to rate this answer.
chaitu
Answered On : Aug 8th, 2007
We declare methods in interfaces, by declaring these methods weprovide signature of method to the class which implements this class.one interface can be implemented by any number of classes. By implementing interfaceclasses follow thesignature given in the interface. The classes must overide all methods in interface.
Login to rate this answer.
An Interface force the end user to implement all the methods declared in the interface, in this way it is ensured that all the extending classes of a particular interface are implementing the same functionality but in their own specific way. for e.g there is an interface called Bank which has several methods now there are several other classes like CitiBank, HDFCBank which extends this Bank interface so they all have to implement the same methods defined in the Bank interface but the implementation logic of those methods could be different.
Login to rate this answer.