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";
   double d = Double.parseDouble(s);
catch (NumberFormatException ex)
   // s is not a double

written by objects \\ tags: , ,

Leave a Reply

You must be logged in to post a comment.