importing package

Discussion in 'Java' started by frank, Dec 10, 2006.

  1. frank

    frank Guest

    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(?)
     
    frank, Dec 10, 2006
    #1
    1. Advertising

  2. frank

    Lew Guest

    frank wrote:
    > 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
     
    Lew, Dec 10, 2006
    #2
    1. Advertising

  3. frank

    frank Guest

    thank you friend for your information
     
    frank, Dec 11, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mhk
    Replies:
    1
    Views:
    616
    Chris Smith
    Nov 28, 2003
  2. Alex
    Replies:
    0
    Views:
    513
  3. Javabean

    importing for package

    Javabean, Mar 1, 2006, in forum: Java
    Replies:
    4
    Views:
    527
  4. Dave
    Replies:
    2
    Views:
    472
  5. plb
    Replies:
    2
    Views:
    355
Loading...

Share This Page