Possible Duplicate:
why we need interface in java?
I refered the following link
can anyone explain any reason why we are using interface in java?
Other than
- multiple inheritance is possible with interfaces.
- polymorphism
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Other than what you have mentioned, interfaces are a good way of exposing a set of functions (API) without divulging any information on their implementation.
By definition, when a class
implementsanInterface, it is agreeing to implementing a series of methods. This will allow any caller to use these methods without: