Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 importing packages
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
cool dude




PostPosted: Sun May 07, 2006 10:41 am   Post subject: 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

code:

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?
Sponsor
Sponsor
Sponsor
sponsor
cool dude




PostPosted: Sun May 07, 2006 10:54 am   Post subject: (No subject)

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




PostPosted: Sun May 07, 2006 1:24 pm   Post subject: (No subject)

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




PostPosted: Sun May 07, 2006 5:50 pm   Post subject: (No subject)

rizzix wrote:
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 Embarassed 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




PostPosted: Sun May 07, 2006 6:30 pm   Post subject: (No subject)

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




PostPosted: Mon May 08, 2006 4:28 am   Post subject: (No subject)

If you want to import some package, that package must be reachable by your program. Usually you have to change your CLASSPATH.[/b]
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: