Java Long.valueOf(String s, int radix)

Syntax

Long.valueOf(String s, int radix) has the following syntax.

public static Long valueOf(String s,  int radix)   throws NumberFormatException

Example

In the following code shows how to use Long.valueOf(String s, int radix) method.


public class Main {
//from   w w  w .  j ava  2s. c  om
   public static void main(String[] args) {

     String str = "123456789098765";
     System.out.println("Value = " + Long.valueOf(str, 10));
   }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable