how can I import a file in java programming language
Take a look at Packages:
If by import a file you meant read a file, there are several ways, probably the most common of which are using the Scanner and BufferedReader objects. Have a look at
http://java.sun.com/javase/6/docs/api/java/util/Scanner.html
and
http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html
respectively for information on how to use them.
You don't import files in Java. You import classes.
The syntax is as follows:
import com.my.Class;
There is nothing like the #include available in C/C++. If you really want to actually "include" files into your source, you need to rethink your design.