The Gnomon Workshop Forums

The Gnomon Workshop Forums (http://forums.thegnomonworkshop.com/index.php)
-   General Chat / Q+A (http://forums.thegnomonworkshop.com/forumdisplay.php?f=14)
-   -   Convert the Strings in Java? (http://forums.thegnomonworkshop.com/showthread.php?t=1923)

Gracey 03-08-2009 23:53 PM

Convert the Strings in Java?
 
Hello,
How to convert String into primitive datatype.also give me a program where you clearly define the primitive datatypes. Please reply my post if you know the answer.

Thanks In Advance

Webby Alisha 03-30-2009 03:45 AM

Quote:

Originally Posted by Gracey (Post 13775)
Hello,
How to convert String into primitive datatype.also give me a program where you clearly define the primitive datatypes. Please reply my post if you know the answer.

Thanks In Advance

using parseInt() method for example

//String to primitive types
int iVal = Integer.parseInt(str);
long lVal = Long.parseLong(str);
float fVal = Float.parseFloat(str);
double dVal = Double.parseDouble(str);


All times are GMT -7. The time now is 22:49 PM.

Forums Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
2000-2013 The Gnomon Workshop, Inc. - All Rights Reserved. No part of this website may be reproduced without written permission.