Adapter converts the interface of an existing class (the Adaptee) into the interface a client expects (the Target), letting classes with otherwise-incompatible interfaces collaborate without modifying either the client or the Adaptee. GoF documents two structurally distinct ways to implement it.
Class Adapter (inheritance-based). The Adapter class INHERITS from Adaptee and implements the Target interface, translating each Target call into the (already-inherited) Adaptee operations. This requires multiple inheritance in the general case (inherit implementation from Adaptee, inherit type from Target) — directly available in C++, and approximated in Java by extending the concrete Adaptee class while implementing the Target interface.
Object Adapter (composition-based). The Adapter HOLDS a reference to a separate Adaptee instance (composition) and implements Target by forwarding/delegating each call to that held instance — the same composition-over-inheritance mechanism examined in Question 26.
Pros/cons — Class Adapter. Because the Adapter IS-A Adaptee, it can override specific inherited Adaptee behaviours directly if needed, and needs only a single object at runtime (no separate Adaptee instance to hold and forward to). Against this: it requires multiple inheritance (unavailable or awkward in single-inheritance languages), and it binds the Adapter to ONE specific concrete Adaptee class at compile time — it cannot transparently adapt any of Adaptee's subclasses as well, since inheritance is fixed to the exact class named.
Pros/cons — Object Adapter. Because it only holds an Adaptee-TYPED reference, a single Object Adapter implementation works polymorphically with Adaptee AND any of its subclasses, and it needs no multiple inheritance, so it works in any OO language (including Java). Against this: every call carries one extra level of delegation indirection, and because the Adapter does not inherit Adaptee's implementation, it cannot override or hook into Adaptee's internal behaviour — it can only call Adaptee's existing public operations, exactly as any other client would.
Left: Class Adapter inherits Adaptee's implementation directly. Right: Object Adapter holds and delegates to an Adaptee instance (works with any subclass).