Results 1 to 6 of 6
  1. #1
    ahdus is offline Member
    Join Date
    Nov 2007
    Location
    India
    Posts
    4
    Rep Power
    0

    Default difference btwn java.awt.* and java.awt.event.*

    does import java.awt.* doesn't import subpackages of awt????


    while writing code for an applet

    its written

    import java.awt.*
    import java.awt.event.*



    doesn't the 1st stsement of code.......include second one too??

  2. #2
    ShoeNinja's Avatar
    ShoeNinja is offline Senior Member
    Join Date
    Oct 2007
    Posts
    124
    Rep Power
    0

    Default

    Yes the first statement includes the second.

    import java.awt.* imports everything in the under awt (including event and everything in it).

  3. #3
    ahdus is offline Member
    Join Date
    Nov 2007
    Location
    India
    Posts
    4
    Rep Power
    0

    Default

    then why do people write both of them in the code.......

    ???????

  4. #4
    Join Date
    Nov 2007
    Posts
    1
    Rep Power
    0

    Default

    the first statement does not include the second.import java.awt.*; this statement import all classes belongs to awt package only.does not import its subpackages.

  5. #5
    ahdus is offline Member
    Join Date
    Nov 2007
    Location
    India
    Posts
    4
    Rep Power
    0

    Default

    which reply among the above 2 is correct??

  6. #6
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    10

Similar Threads

  1. Replies: 3
    Last Post: 03-26-2009, 10:31 PM
  2. Generate an event to another java application
    By i_berbeu in forum Advanced Java
    Replies: 18
    Last Post: 05-12-2008, 01:57 PM
  3. Difference between ASP and JSP
    By barney in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 08-07-2007, 07:15 AM
  4. whats the difference between Java core,J2EE......
    By prince24 in forum New To Java
    Replies: 2
    Last Post: 07-11-2007, 06:54 PM
  5. Replies: 2
    Last Post: 07-04-2007, 05:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •