Lets go straight into it;
import
Because of the straight solid source code naming convention, the Javac compiler can easily find the corresponding source or class files just from the fully qualified name of a package and class. By fully qualified I mean like the specific package name ETC.
Example:
[code=java]java.util.ArrayList x = new java.util.ArrayList ( 149 );[/code]
The other option to this long-spaced style of coding, is to use import statements. A typical set of import statements.
Example:
Code:
import java.io.*;
import java.util.ArrayList;
import java.util.Date;
They must come right after the package statement, before the class statement. They are traditionally kept placed and organized in alphabetical order.
Lets say you import something from within your source. Ands its named... Boobies?
You would do it like this:
Code:
import com.name.Jvs.Boobies;
But nessasarily, it doesn't always have to be like that.
There is also another form of import you can use.
Code:
import.com.name.Jvs.*;
Then you can refer to the class as plain Boobies,
static methods as MyClass.myStaticMethod()
and static variables and constants as MyClass.myStaticValue,
without the com.mindprod.mypackage qualification.
There is no form of the import that lets you get away with coding your references
without MyClass, e. g. just myStaticMethod() or myStaticValue.
Also a little tip when using imports. Try keeps your Class names origional, avoid name clashes
or you'll be in big trouble.
Hope this helped.