Reputation: 35
Hello everybody I am a beginner of Java. I am blocked at this point with the following program:
import prog.io.Orario;
import prog.io.ConsoleOutputManager;
class primoprogramma{
public static void main(String[] args){
ConsoleOutputManager video=new ConsoleOutputManager();
video.println("ciao");
}
}
That gives me the error:
bad class file: ./prog/io/Orario.class
class file contains wrong class: prog.utili.Orario
Please remove or make sure it appears in the correct subdirectory of the classpath.
I did everything I could tried in those days but nothing works. Here there the class Orario:
package prog.utili;
public class Orario {
private static char separaratore=';';
}
Thank you for any advice
Upvotes: 2
Views: 142
Reputation: 20614
Your class Orario
has the wrong package declaration (package prog.utili;
instead of package prog.io;
)
prog.io.Orario
.Orario
in a file Orario.class
in directory prog/io
.prog.utili
declared which is not the desired one - ErrorUpvotes: 4
Reputation: 11434
In java, directorys are the same as package names.
So, a class Orario in the package prog.utili
have to be in a directory prog/utili instead of prog/io
Upvotes: 1