How does the Adapter design pattern enable the compatibility between two incompatible interfaces?

  • By changing the source code of one of the interfaces
  • By creating a new interface to bridge the two incompatible interfaces
  • By making one interface dependent on the other
  • By removing one of the interfaces
The Adapter design pattern enables compatibility between two incompatible interfaces by creating a new interface (the adapter) that acts as a bridge between the two. This adapter converts the methods of one interface into methods that the other interface can understand, making them compatible without changing their source code.
Add your answer
Loading...

Leave a comment

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