Decode a string to create long value
static Long decode(String nm)
- Decodes a String into a Long.
decode(String nm) accepts decimal, hexadecimal, and octal numbers given by the following grammar:
+/- 0x HexDigits
+/- 0X HexDigits
+/- # HexDigits
+/- 0 OctalDigits
public class Main {
public static void main(String[] args) {
Long longObject = Long.decode("0Xff");
System.out.println(longObject);
}
}
The output:
255
Home
Java Book
Essential Classes
Java Book
Essential Classes
Long:
- Long class
- Constants value from Long class
- Constructors from Long
- Convert long value to byte, double, float, int, long, short
- Decode a string to create long value
- Get the long value from a system property
- Compare two long values
- Parse long value from string
- Convert long value to binary, hex and octal format strings
- Convert long value to string
- Get the sign of the long value
- Get the number of zero bits preceding and following
- Reverse and rotate a long value