Sep 03

The Long class contains a number of (static) methods for converting to/from various formats. To convert to a long use static method Long.parseLong()

String s = "123";
   long l = Long.parseLong(s);
catch (NumberFormatException ex)
   // s is not a long

written by objects \\ tags: , ,

Leave a Reply

You must be logged in to post a comment.