Results 1 to 3 of 3
  1. #1
    diRisig is offline Member
    Join Date
    Feb 2008
    Posts
    6
    Rep Power
    0

    Default import statement.

    Hello All,

    when using the import statement does it referrer to a directory or something else(a package) ?

    I have been looking at some code which has:
    Java Code:
    import Jama.util.*;
    I have downloaded the source for JAMA but i don't know where to put it on my machine(WinXP) so that I will be able to use the same statement to use it.

    Can anyone help?

    p.s. coming from C++ does the "import" statement relate to the "include" statement?

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    Have a look-see here.

    Import is similar to C++'s include, but with C++ the included file is well, obviously - actually included, whereas with Java, the imported package is made available rather than included.

    Hope this helps.
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  3. #3
    diRisig is offline Member
    Join Date
    Feb 2008
    Posts
    6
    Rep Power
    0

    Default

    Hello that that helps on a conceptual level.


    On a practical level i found i could (with a Netbeans project) put all the source files from the JAMA source in a folder project_folder\src\jama and then add this folder to the project's source-files-folder in project options and then use the import statement:
    Java Code:
    import Jama.*;

Similar Threads

  1. error with import java.io.*
    By osval in forum New To Java
    Replies: 5
    Last Post: 05-13-2010, 05:03 PM
  2. how to import a picture into an applet
    By cecily in forum Java Applets
    Replies: 2
    Last Post: 01-15-2010, 08:51 PM
  3. how to import jface in java swt
    By rajaletchumy in forum New To Java
    Replies: 1
    Last Post: 08-08-2007, 12:31 AM
  4. I can't import javax.mail
    By katie in forum New To Java
    Replies: 2
    Last Post: 08-04-2007, 05:05 PM
  5. Statement or Prepared Statement ?
    By paty in forum JDBC
    Replies: 3
    Last Post: 08-01-2007, 04:45 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
  •