Convert String to Long in Java

String

This example shows how to convert a String to Long data type in Java.

Output:

String to long conversion using valueOf :2323232
String to long conversion example using Long object: 4444444444444444444
String to long conversion using parseLong() method: 999999999999999999
String to long conversion using decode() method: -1023454
String to long example in hex format decode() method: 65535
String to long example in octal format decode() method: 511
Share This Post On: