Featured Post

How to Integrate Google Tag Manager with Drupal 9 - An Easy Step-by-Step Tutorial

  Marketers are always seeking new ways to elevate website engagement and maximize interactivity. Yet, managing the countless third-party in...

Difference between Abstract class and Interfaces.

Abstract class:

  • Abstract class comes under partial abstraction.
  • Abstract classes can maintain abstract methods and non abstract methods.
  • In abstract classes, we can create the variables.
  • In abstract classes, we can use any access specifier.
  • By using 'extends' keyword we can access the abstract class features from derived class.
  • Multiple inheritance is not possible.

Interface:

  • Interface comes under fully abstraction.
  • Interfaces can maintain only abstract methods.
  • In interfaces, we can't create the variables.
  • In interface, we can use only public access specifier.
  • By using 'implement' keyword we can get interface from derived class.
  • By using interfaces multiple inheritance is possible.

No comments:

Post a Comment

Popular Posts