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

Username:   Password: 
 RegisterRegister   
 How do I get input and transfer it into a string variable??
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DanShadow




PostPosted: Wed Feb 11, 2004 3:51 pm   Post subject: How do I get input and transfer it into a string variable??

I have never found a way to get the user to input something, and to save it under a variable name in Java...like, its easy in other languages.
Turing: get
C++ cin
etc.
I found something that gets integers...but it isnt helping.
code:

String number;
int choice;
System.out.print("Enter a number: ");
choice=Integer.parseInt(number);

Im pretty new at java...so any help would be greatly appreciated. Thanks!
Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Wed Feb 11, 2004 5:04 pm   Post subject: (No subject)

For this purpose you can read my tutorial on JOptionPane, where you can use dialog boxes to input strings.
at http://www.compsci.ca/v2/viewtopic.php?t=3486
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  [ 2 Posts ]
Jump to:   


Style:  
Search: