package whales; // The following is analogous to an ML "open ModuleName" declaration: // it allows you to refer to names in a package without prefixing them // with the fully qualified name. import whales.baleen.*; public class KillerWhale { // This method's signature is illegal, because StealthyWhale has // package visibility to whales.baleen. public void eat(StealthyWhale sw) { System.out.println("Drat! Foiled!"); } // This method's signature is legal, but its implementation... public void eat(HumpbackWhale hw) { // ... calls the package-visibility method greet(), which is illegal. hw.greet(); System.out.println("Drat! Foiled again!"); } }