Here you can find the source of parseInt(char[] strs, int beginindex, int endindex)
private static int parseInt(char[] strs, int beginindex, int endindex) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; public class Main { private static int parseInt(char[] strs, int beginindex, int endindex) throws ParseException { int result = 0; int b = 1; for (int i = endindex - 1; i >= beginindex; i--) { if (strs[i] < 48 || strs[i] > 57) { throw new ParseException("Parse error,can't parse char to int . ", 0); }/*w ww.jav a2s . c om*/ result = result + (strs[i] - 48) * b; b *= 10; } return result; } }