What "Import" Do

Hi everyone sorry for posting that many MSG up.

I have fix my error in the JDK file hehe thanks to that guy who give me the link. Now I running hehe.

Ok ok now back to the qestion: What do import do

will it effect the compiler time and run time

so can i just leave IMPORT out

e.g Import java.Awt.*;

Import javax.Swing.*;

Public filename......

So can i leave the IMPORT out:

(will java do it by defult using the path we set to look for the stuff it need to complier the file)

and one more thing

Imoprt java.Awt.*

Import java.Lang.*

Etc....

can i just go import java.* and it will import both the things i wanted

Thanks in advance

[744 byte] By [unknow] at [2007-9-26 1:24:59]
# 1
See http://forum.java.sun.com/thread.jsp?forum=31&thread=147965The import statement is rather a convinience - thanks to it we don't have to use the fully qualified class names all the time!
jsalonen at 2007-6-29 1:05:52 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2

You can always leave import out, but you must fully qualify the classes from other packages. The import statement and the classpath do not do the same thing. There is no effect on the runtime... the import statement just give the compiler enough information so it can qualify the class names for you. You import classes, not packages, and cannot use the * import-on-demand to import multiple packages.

schapel at 2007-6-29 1:05:52 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 3
Go to the Java Tutorial and search for "import": http://java.sun.com/docs/books/tutorial/getStarted/TOC.html
thomasfly at 2007-6-29 1:05:52 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 4

Ugh! They refer to importing packages. That isn't correct. The * form of import is called import-on-demand and imports a class from one of the packages if the class is not found in the current package. This distinction is important if you have a class in the current package that has the same name as one of the import-on-demand classes.

schapel at 2007-6-29 1:05:52 > top of Java-index,Archived Forums,New To Java Technology Archive...