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

Username:   Password: 
 RegisterRegister   
 reading Double
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
S_Grimm




PostPosted: Mon Oct 20, 2008 11:05 am   Post subject: reading Double

so, i need to learn how to read double, long, short, byte, char and float. i know how to read int (using parseInt) and string (using readLine) i would like to know how to read the rest of them.
Sponsor
Sponsor
Sponsor
sponsor
HellblazerX




PostPosted: Mon Oct 20, 2008 11:28 am   Post subject: RE:reading Double

Double.parseDouble ()
Long.parseLong ()
Short.parseShort ()
Byte.parseByte ()
Float.parseFloat ()

All work in the same way as parseInt ().

As for reading char, remember that Strings store char values in an array. So if you want to get input of just one character, get the input as a String, and find the character in the first position:
string.charAt (0).
S_Grimm




PostPosted: Mon Oct 20, 2008 2:26 pm   Post subject: RE:reading Double

thanks
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  [ 3 Posts ]
Jump to:   


Style:  
Search: