importing package

F

frank

hai in our program we include java.awt.* package to use the components.
if we import this package,all the properties can used to our
program.then why
we import the java.awt.event.*?(when we use the java.awt package the
event class proprties also imported(?)
 
L

Lew

frank said:
hai in our program we include java.awt.* package to use the components.
if we import this package,all the properties can used to our
program.then why
we import the java.awt.event.*?(when we use the java.awt package the
event class proprties also imported(?)

Packages are not hierarchical.

/import java.awt.*/ only imports all the classes in /java.awt/, not the
packages. So /java.awt.client.*/ classes are not imported unless you also
import that package explicitly.

- Lew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top