Visibility

By default, a class can only see the other classes in its package.

package dungeon;

class BugBear {

}
package village;

class Villager {

}
package dungeon;

class Dwarf {
    BugBear fight() {
        // Can "see" BugBear and thus call its constructor,
        // access visible fields and methods, etc.
        return new BugBear();
    }

    // Cannot see Villager because it is in a different package.
}