Convert String to long with Long.parseLong in Java
Description
The following code shows how to convert String to long with Long.parseLong.
Example
//from w ww . j a v a2 s.com
public class Main {
public static void main(String[] args) {
String str = new String("10");
long l = Long.parseLong(str);
System.out.println(l);
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »