Sep
03
|
The Double class contains a number of (static) methods for converting to/from various formats. To convert to a double use static method Double.parseDouble()
String s = "123.456"; try { double d = Double.parseDouble(s); } catch (NumberFormatException ex) { // s is not a double }
Leave a Reply
You must be logged in to post a comment.