What is wrong the Java enum definition -
I defined public Enum ABC in ABC.java and then it was abc. Compiled in class.
In another XYZ.java, I use Private ABC _abc .
XYZ and ABC are in some packages.
But this signal class ABC .
What's wrong?
Package Teacher 26; In other files, I use
package teacher 26; Public class questionnaire {private semester _ shweta;
Collect commands: javac -d ../classes/ Questionnaire.java
semester.class .. / class / teacherII / Semester.class Before I compile the questionnaire. Java
Thank you very much for your reply. Season is that, Chris and Vineet had said that, I did not classpath during the compilation of the questionnaire. It works now thanks you again!
It seems that you are not compiling correctly
your The definition of enum looks ok because you are receiving this error message because the compiled ( .class
) file does not exist (or accessible) when you are trying to compile another file
Then, for example:
---- Ezava ---- package a; Public enum A {one, two, three} ---- B.java ---- package a; Public category B {Ax; }
will compile it properly: javac ajava bjava
but it will fail, for example, if you compiled the first seedling Do:
javac B.java B.java:3: symbol symbol can not be found: class one location: class aB a x; ^ 1 error
I think that something like this is happening to you.
So, basically check your classpath when compiling.
Comments
Post a Comment