The purpose of a classpath and import statements are different. Import statements don't find classes. They rely on the classloader to do this, and it uses the classpath.
The import statement tells a Java class the fully qualified package name of a class being used. You don't need to use it. For example, you could write a class like this: <blockquote>code:<pre name="code" class="core"> package foo.bar;
The purpose of a classpath and import statements are different
Not true at compile time(the only time the import has any effect). In fact they compliment each other. The compiler connects the path given in the import statement to the classpath to create the full path to the class definition. For example: if a class is in package pkg and the class file is located at: C:\javastuff\project\pkg\PGM.class then the classpath should be set to: C:\javastuff\project for the package pkg referenced in your program by: import pkg.*;