-
package????????[Solved]
OK I admit that this is a school assignment. But I'm not asking anyone to do the assignment for me. Just have some questions about Java.
I had some Classes at school that worked perfectly. On of the is a Terminal Class that the author of our book has made for us, so it is going to easier for us to use input from the Keyboard. I'm using it in my class ( a CD class). But I keep on getting this error when trying to compile the CD class...
-----------------------------------------------------------------
CD.java [62:1] cannot access Terminal
bad class file: E:\javas\Terminal.class
class file contains wrong class: inn1.Terminal
Please remove or make sure it appears in the correct subdirectory of the classpath.
cdNummer = Terminal.lesInt();
^
1 error
Errors compiling CD.
-----------------------------------------------------------------
The Terminal class and the CD class is in the same directory. And I have compiled the Terminal class before I tried to compile the CD class. BTW cdNummer is an variable of type Int. And the lesInt() method in the Terminal is supposed to read an int from the keyboard.
Question
When I open up the Terminal Class this line is on the top:
package inn1;
We have not learned anything about packages yet, so I did not put it there. And if I remember right "inn1" was the folder where I used the Terminal class last time. Has this something to do with it. I have not the line in any other of my classes. But if I take the line out of the Terminal class, then I can compile the CD class without any errors. But I still have an red line under the line:
cdNummer = Terminal.lesInt();
Anyone know what to do to fix this???
-
I have no idea why, but after I went back to NetBeans, and I took away the pacage line from the Terminal class the red line dissepered from the CD class...suppose it was just a bug...