Originally posted by Kiran H Iyer:
I have created a package.Then i tried to acces a class inside that class by using import package.*;
But it is not accessible.But if we r giving it as pimport package.class it will work.
In order to find a class in a package, the jar file (package) must be on the classpath and the class you are trying to access in the package must be declared public.
How to put the jar on the classpath depends on your OS. In Windows, you can
set CLASSPATH=%CLASSPATH%;c:\myjars\newjar.jar
The jvm walks the classpath until it finds the package that you are talking about. Remember, too, that a jar is-a directory.