Java Long.decode(String nm)

Syntax

Long.decode(String nm) has the following syntax.

public static Long decode(String nm)   throws NumberFormatException

Example

In the following code shows how to use Long.decode(String nm) method.

The following code decodes a long value in hexadecimal format.


public class Main {
  public static void main(String[] args) {
    Long longObject = Long.decode("0Xff");
    System.out.println(longObject);//ww  w  . j ava 2  s. co m

  }
}

The output:





















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