Somewhere I have read import java.*; This example will compile, and it will try to import any classes within the directory java. It will not, however, import any of the packages located in subdirectories of java. In the preceding instance, there are no classes located directly in the Java package, therefore nothing will be imported.
But in the above coding,it did show compile error as stated
And consider the below program that worked successfully without any error.
And another class in different package
What is the rule behind using import java.* (or) import payroll.*; .Please help me.