This method parses the string argument s as a signed long in the radix specified by the second argument radix.
Syntax:Library: java.lang.Long
public static long parseLong(String s, int radix) throws NumberFormatException
Example:import java.lang.*;
public class LongDemo {
public static void main(String[] args) {
// parses the string with specified radix
long a = Long.parseLong("0", 10);
System.out.println(a);
long b = Long.parseLong("111", 10);
System.out.println(b);
long c = Long.parseLong("-0", 10);
System.out.println(c);
long d = Long.parseLong("-BB", 16);
System.out.println(d);
long e = Long.parseLong("1010110", 2);
System.out.println(e);
long f = Long.parseLong("2147483647", 10);
System.out.println(f);
long g = Long.parseLong("-2147483648", 10);
System.out.println(g);
long h = Long.parseLong("ADMIN", 27);
System.out.println(h);
}
}
Output:
0
111
0
-187
86
2147483647
-2147483648
5586836
License.
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 265 / 158767637. Delta: 0.03661 с