
-----------------------------------
cool dude
Sun May 07, 2006 10:41 am

importing packages
-----------------------------------
i'm trying to import a package into java, but it says package does not exist. although i see on many other java programs made that they imported it and without this package the program won't run. this is the package i want to import


import hsa.Console;


i could import other packages but for some reason i can't import this one. maybe i have to download this package so does anyone know the site where i can download it?

-----------------------------------
cool dude
Sun May 07, 2006 10:54 am


-----------------------------------
nevermind i think its just like Scanner to get the user input so i can just change it to import java.io.*; and use the BufferedReader instead.

-----------------------------------
rizzix
Sun May 07, 2006 1:24 pm


-----------------------------------
In java you do not import Packages. You only import Classes.

You may import one specific class from a package, or all the classes from a package (using *).

-----------------------------------
cool dude
Sun May 07, 2006 5:50 pm


-----------------------------------
In java you do not import Packages. You only import Classes.

You may import one specific class from a package, or all the classes from a package (using *).

oh srry didn't know :oops:  do u know why i can't import the console class or the scanner class? i got the latest version i think from the java sun website.

-----------------------------------
wtd
Sun May 07, 2006 6:30 pm


-----------------------------------
The HSA stuff is specific to Ready To Program.  I would suggest ignoring it unless a class forces you to use it.

As for Scanner, as long as you have JDK 1.5.0.x you sould be able to import java.util.Scanner.

-----------------------------------
Onega
Mon May 08, 2006 4:28 am


-----------------------------------
If you want to import some package, that package must be reachable by your program. Usually you have to change your CLASSPATH.[/b]
