Accessing class of a Package
import testpackage.*;
publicclass TestNonPackagePackageAccess{
publicstaticvoid main(String args[]){
testpackage.TestPackageNonPackageAccess tPNP =new testpackage.TestPackageNonPackageAccess();
System.out.println(tPNP);
String classDesc ="Class without Package declartion";
System.out.println(classDesc);
}
}
In the above code I have:
import testpackage.*;
Even after importing the package I once again have to explicitly use
testpackage.TestPackageNonPackageAccess tPNP = newtestpackage.TestPackageNonPackageAccess();
without the package prefix i get an error. then why do we use imports in the first place.

