Import Statements in Java


Prev Tutorial Next Tutorial

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.

import statement

Syntax

	import package1.package2.......*;
import statement

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.


Prev Tutorial Next Tutorial

Advertisements




Facebook Likes

Advertisements