Quick Answer
Adapter pattern makes incompatible interfaces work together. Creates a wrapper (adapter) that translates one interface into another. Object adapter: holds a reference to the adaptee, translates calls. Class adapter: extends the adaptee (rare in Java due to single inheritance). Example: java.io.InputStreamReader adapts InputStream (byte stream) to Reader (character stream) interface.
Answer
Converts interface of one class into another expected by client. Enables integration of incompatible systems. Useful for legacy code and third-party APIs.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.