Specifications
Sun Services
Java™ Programming Language
Module 7, slide 43 of 44
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Multiple Interface Example
public class Harbor {
public static void main(String[] args) {
Harbor bostonHarbor = new Harbor();
RiverBarge barge = new RiverBarge();
SeaPlane sPlane = new SeaPlane();
bostonHarbor.givePermissionToDock(barge);
bostonHarbor.givePermissionToDock(sPlane);
}
private void givePermissionToDock(Sailer s) {
s.dock();
}
}










