Here you can find the source of toInt(String str, int val)
public static int toInt(String str, int val)
//package com.java2s; // it under the terms of the GNU General Public License as published by public class Main { public static int toInt(String str) { return Integer.parseInt(str); }/*from w w w . j a v a 2s. c o m*/ public static int toInt(String str, int val) { return str != null ? Integer.parseInt(str) : val; } }