Saturday, April 17, 2010

Java Wrapper Classes :: Converting String Values Into Double Values


In previous example we discussed how to convert string values into integer values. Double values and float values are used in floating-point calculations. We can use following methods available in relevant classes.

Syntax : Converting String values into Double values
double d1=Double.parseDouble("89223.4234312454");

Syntax : Converting String values into Float values
float f1=Float.parseFloat("2.32323");

Note : Remember  that the Float is not a keyword. It is a class name.

0 comments:

Post a Comment

Stats

ලාංකීය සිතුවිලි

lankeeya sithuwili

Blog Catalogs

 

Let's Learn Java API. Copyright 2010 All Rights Reserved