The problem I'm having with the packages is the following: I need to model a prison system, for which I have to create different classes such as Jail, MaximumSecurity and Minimum Security. These must be found in the package um.prog1.carcel. In the package um.prog1 the classes SistemaPenitenciario must be placed and the interfaces must place in the package um.prog1.interfaces. In addition, the Main class will be found in the package um.prog1, I'm staying like this:
package um.prog1.carcel;
public class Carcel{
//codigo
}
package um.prog1.carcel;
public class MaximaSeguridad{
//codigo
}
package um.prog1.carcel;
public class MinimaSeguridad{
//codigo
}
package um.prog1;
public class SistemaPenitenciario{
// codigo
}
package um.prog1.interfaces;
public class Interface{
//codigo
}
package um.prog1;
public class Principal{
public static void main(String[]args){
//codigo
}
}
The issue is that when I want to compile it from the cmd I do not know if I have to position myself in my source folder and compile it javac um \ prog1 \ Principal.java . But I do not know how to put it to execute it, I already try changing \ by point but it tells me Error: the main class has not been found or loaded. I do not know if maybe it's an error in the package definition in the classes or if I'm putting it wrong to execute it.