Results 1 to 2 of 2
  1. #1
    orrymr is offline Member
    Join Date
    Aug 2009
    Posts
    1
    Rep Power
    0

    Default help with importing packages

    Hi,

    I created a simple program where I wanted to use the GeneralPath class which is found in java.awt.geom.GeneralPath. At first I only imported java.awt.*, but when my program couldn't compile, I explicitly imported java.awt.geom.GeneralPath. When I did this, my program worked without any problems. My question is, why did I have to explicitly import this class, when the .* at the end of java.awt refers to all of it's sub-packages and subclasses? Surely it should also include the GeneralPath class?

    Thanks in advance :)

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    because importing awt.* does not import awt.geom.*
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

Similar Threads

  1. Importing JXL API
    By ryanlbowen in forum New To Java
    Replies: 0
    Last Post: 07-17-2009, 08:17 PM
  2. importing packages at the same level
    By Bharat in forum New To Java
    Replies: 3
    Last Post: 03-30-2009, 04:17 AM
  3. importing external packages
    By bubbles in forum New To Java
    Replies: 3
    Last Post: 01-21-2009, 12:42 AM
  4. Replies: 3
    Last Post: 02-12-2008, 12:03 PM
  5. Using packages
    By prfalco in forum New To Java
    Replies: 5
    Last Post: 01-31-2008, 11:38 PM

Posting Permissions

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