Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't resolve symbol class

Status
Not open for further replies.

sheila11

Programmer
Dec 27, 2000
251
US
Hi all,

I have two files in one folder: AutoShop.java, and TestAutohop.java. I compiled AutoShop.java. When I try to compile TestAutoShop.java, it gives me error saying: cannot resolve symbol class AutoShop, and pints to the word "AutoSop" in the code. What may be the problem?
My code is as follows:
AutoShop.java:
public class AutoShop {
void displayHoursOfOperation() {
System.out.println("Store Hours:");
System.out.println("Daily: 9:00 AM - 21:00 PM");
}
}
TestAutoShop.java:
public class TestAutoShop {
public static void main(String[] args) {
AutoShop m = new AutoShop();
m.displayHoursOfOperation();
System.exit(0);
}
}
Please help.
Sheila
 
Do you have . (the current directory) on your CLASSPATH? If not than you should.
 
Would the first file get compiled even if the classpath does not have the current directory in it? It didn't give any error while compiling the AutoShop.java. Only the second file compilation had errors.
 
The first class doesn't reference the second class so there would not be a problem until trying to compile the dependent class.
 
Hi sheila11,
Check out the highlighted part of the code in your original copy.
public class TestAutoShop {
public static void main(String[] args) {
AutoShop m = new AutoShop();
m.displayHoursOfOperation();
System.exit(0);
}
}
You'd have possibly commited a spelling error.

Regards,
Rajarajan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top