Here you can find the source of toInt(String str, int defValue)
public static int toInt(String str, int defValue)
//package com.java2s; public class Main { public static int toInt(String str, int defValue) { try {// w w w. j a va2 s . c o m return Integer.parseInt(str); } catch (Exception e) { } return defValue; } }