Here you can find the source of toInteger(String str)
public static int toInteger(String str)
//package com.java2s; //License from project: Apache License public class Main { public static int toInteger(String str) { return toInteger(str, Integer.MIN_VALUE); }/*from w w w .ja v a2 s.c om*/ public static int toInteger(String str, int defaults) { int result = defaults; try { result = Integer.parseInt(str); } catch (Exception e) { } return result; } }