Adapter Design Pattern
Adapter Design Pattern
Arnob Deb
Lecturer, Daffodil International University
What is Adapter Design Pattern?
• - Structural design pattern that allows
incompatible interfaces to work together.
• - Acts as a bridge between two incompatible
classes.
• - Converts one interface into another that a
client expects.
Bonus Answer
• // 🎯 Target Interface (Expected Format - European Plug)
• interface EuropeanPlug {
• void connectEuropeanSocket();
• }
• @Override
• public void connectEuropeanSocket() {
• System.out.println("Adapter converts US plug to fit European socket.");
• usPlug.connectUSSocket(); // Calls the existing US plug method
• }
• }