Import statements in Java
Import is a keyword in java language used to import the predefined properties of java API into current working java program.
Syntax
import package1.package2.......*;
Used to import all the predefined properties of given package.
Syntax
import pack1.package2.............Class_Name/Interface_Name;
Used to import specific class or interface in a java program.
Java API is a collection of package, package is a container which is collection of predefined classes and interfaces.
Note: Import statement should be the first statement of the java programs.
No comments:
Post a Comment