Here you can find the source of convertInt(String str, int radix)
public static Number convertInt(String str, int radix) throws NumberFormatException
//package com.java2s; public class Main { public static Number convertInt(String str, int radix) throws NumberFormatException { long x = Long.parseLong(str, radix); if (x <= (long) Integer.MAX_VALUE && x >= (long) Integer.MIN_VALUE) { return new Integer((int) x); }//from w w w .ja v a2s . c o m return new Long(x); } }