IT. Expert System.

Java basics

parseLong()


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


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

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 с