Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
public class FishingBoatAdapter implements RowingBoat {

    private FishingBoat boat;

    public FishingBoatAdapter() {
        boat = new FishingBoat();
    }

    @Override
    public void row() {
        boat.sail();
    }
}
Code Block
languagejava
class AdapterApp {
    public interfacestatic RowingBoat void main(String[] args) {
    void     Captain captain = new Captain(new FishingBoatAdapter());
        captain.row();
    }
}