Here you can find the source of tryParse(String s, int i)
public static int tryParse(String s, int i)
//package com.java2s; // This software is distributed under the following license: public class Main { public static int tryParse(String s, int i) { try {//from w w w . j av a2s . c om return Integer.parseInt(s); } catch (Exception e) { return i; } } }