What’s the difference between the following keywords in Java: implements, extends?
What’s the difference between the following keywords in Java: implements , extends ?
Share
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.
An
interfaceis an abstract specification of how aclassshould behave whilst aclassis a concrete implementation of such a specification.Therefore, when you write
implementsyou’re saying that you are fulfilling some abstract specification in the implementation you’ve written.extendsmeans that you take either an implementation (class) or specification (interface) and add to it with different or new functionality (or change the specification of its behaviour), thus modifying its behaviour and extend-ing it.