Problems setting up java files that I downloaded from a publisher's website
I am using a data structures book that has 4 files I downloaded from the publisher's website. The 4 files are
I have all of these into one package in Eclipse called CarWashPackage.
the last file above seems to be the main class using the other 3 classes. It has this information at the top of the file:
// FILE: Carwash.java
// This program illustrates the use of the carWashSimulate method which uses
// a simple queue to simulate cars waiting at a car wash.
I'm trying to coordinate these files together and there are 2 problems:
1) The import statements above are from what the publisher wrote and refers to the publisher's computer or website and I don't know how to change this to reflect my computer where I have them stored. I have the files on my C drive:
2) at the top of the CarWash.java file, it has a red x saying, "The declared package** does not match the expected package CarWashPackage"
I don't know how to fix problem 1 or 2
Re: Problems setting up java files that I downloaded from a publisher's website
Your classpath/packages seem to be incorrect, seems you are trying to import a package that does not exists. If your files are all in the same package, there isn't a need to import them (although it makes it clearer when you do). So my suggestion is to either place your files in a package named edu.colorado.simulations, or remove the import statements (if all classes are in the same path/package).