I have a Main.java file:
public class Main{
private EntityDrawer entityDrawer;
public void setEntityDrawer(EntityDrawer entityDrawer) {
this.entityDrawer = entityDrawer;
}
public EntityDrawer getEntityDrawer() {
return entityDrawer;
}
}
class EntityDrawer {
private Empleado empleado;
public Empleado getEmpleado() {
return empleado;
}
public void setEmpleado(Empleado empleado) {
this.empleado = empleado;
}
}
If I try to access from another file, it works if I only try to access the entityManager:
Main main = new Main();
main.getEntityDrawer(); // NO PROBLEM!
But if I try to access one of the attributes (even if public) from entityManager, it does not work:
Main main = new Main();
main.getEntityDrawer().getEmpleado(); // Gives error "The type EntityDrawer is not visible"
I cannot understand why is happening, could someone give me some insight into this issue?...
I assume you are trying to use a package local class
EntityDrawer
in another package, which you cannot do.Try making the class
public