java.lang.Long.parseLong(String s, int radix)


java.lang.Long.parseLong(String s, int radix)

package com.codingdict;



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);

   }

}