This tutorial will show you how to “include” other classes in your Java app.

Prerequisites
You should have JDK installed and an editing environment you are comfortable with.
Java:Tutorial - Getting Started

You should know how to create classes within your IDE
http://forum.codecall.net/java-tutorials/1706-java-tutorial-hello-world.html

The Idea
In Java, you have the opportunity to import other class files that do most of the work for you.

Solution
In Java we import class files by simply writing the word include and then the path to the file you want to include. For example

Code:
import javax.swing.JFrame;
Which imports the JFrame class. You could also do this
Code:
import javax.swing.*;
The asterisk imports everything in the javax.swing package. The import code is placed after your package declaration and before your class header. For example:
Code:
package foobar;
import javax.swing.*;
public class MyClass {

}
Along the same lines you can import your own files in your own package. For example, if you name a package “mypackage” and in that package there is a class called “myclass” you can import that class like this:

Code:
import mypackage.myclass.*;
Conclusion
When programming in Java you are provided with many classes that do all the hard work for you. When creating even a basic program you will import at least one class.