Import statement in java is used to import other existing packages (all the classes in the package) or specific classes (a particular class within the package) to the current class. [Note: In real time, an import statement tells the compiler the location of the java files that are been used in current class. In this way compiler knows the location of the .java files and can convert all of them into .class files which can be feed to JVM to be converted into 0s and 1s.
If user wants to access Java files of package A, they can do so by using import statements.- import A.*; - This statement will help to import all the classes (in turn all the methods in the classes) in package A.