Quantcast
Channel: web development helpdesk » long
Viewing all articles
Browse latest Browse all 4

How to convert a String to a long in Java?

$
0
0
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"; try { long l = Long.parseLong(s); } catch (NumberFormatException ex) { // s is not a long }

Viewing all articles
Browse latest Browse all 4

Trending Articles