1

Why an abstract class that implements an interface has not the necessity to implements interface's methods while instead a class has the necessity to implements all the methods?

1
  • 4
    The whole point of abstract classes is that you don't have to implement every method. Commented Jul 18, 2012 at 9:40

4 Answers 4

7

Since an abstract class leaves the implementation of one or more of it's methods to it's extending classes, it can do the same with the method contracts it inherits through implementing additional interfaces.

Sign up to request clarification or add additional context in comments.

Comments

1

It is not necessary that class has to implements all the methods of an implemented interface. If class don't implement all the methods of an interface it can be declared as abstract class.

Comments

1

Abstract class, by definition, is a class that can have unimplemented methods. If an abstract class implements an interface, it is not bound to implement any of the the inherited methods. That doesn't mean you can't implement any of them. :D

Comments

0

Ultimately we have to create a concrete class. Only then we are going to create an instance and use it. Moreover after implementing an interface an abstract class won't become a concrete class but if a concrete class leaves a method unimplemented it must become an abstract class.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.