Public Classes
To be able to use a class in one package from a different package,
you must first mark that class as public
.
package village;
// Now other packages will be able to see it
public class Villager {}
To be able to use a class in one package from a different package,
you must first mark that class as public
.
package village;
// Now other packages will be able to see it
public class Villager {}