Here you can find the source of toInt(String str, int defValue)
public static int toInt(String str, int defValue)
//package com.java2s; //License from project: LGPL public class Main { public static int toInt(String str, int defValue) { try {/*from w ww.java 2 s . c om*/ return Integer.parseInt(str); } catch (Exception e) { } return defValue; } public static int toInt(String obj) { if (obj == null) return 0; return toInt(obj, 0); } }