Short notes on import statement:
In Java, Import statement is used for referring either all the classes & interfaces of the specific package (or) a specifying about particular class/interface of a specific package in our java program.
Syntax:
(i) import package1.package2…..*;
It is used to import all the predefined properties of specific package.
(ii) import package1.package2….classname/interfacename;
It refers either one class (or) one interface of a specific package but not all.
Advantages of ‘import’:
(i) Easier to provide access control.
(ii) Name conflicts i.e Name space collision is avoided.
(iii) Reusability.
Hope this information helps!