Interface vs Abstract Class

Interface 

  1. Click here for complete interface explanation.
  2. Can have only unimplemented methods.
  3. Supports multiple inheritance
  4. Can have only static and final variables.
  5. Methods can’t be static.
  6. Interface can’t hold main method or constructor.
  7. Interface can’t extend/implement abstract class.
  8. Keyword ‘interface’ is used to declare.
  9. Interface can extend other interface. Even More than one interface also.
  10. Signature below

Abstract Class

  1. Click here for complete abstract class explanation.
  2. Can have implemented and unimplemented methods. Means can have both abstract and non-abstract methods.
  3. Doesn’t support multiple inheritance.
  4. This can have non-final, final, static and non-static variables.
  5. Methods can be static.
  6. Can hold main method or constructor.
  7. Abstract class can extend other ordinary class or abstract class.
  8. Keyword ‘abstract’ is used..
  9. Abstract class can extend at most only one class.
  10. Signature below

 

If you like the post then please socialize it. Happy Sharing. Loudly Subscribing.

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.