Here you can find the source of tryParse(String val, int defaultValue)
public static int tryParse(String val, int defaultValue)
//package com.java2s; //License from project: Apache License public class Main { public static int tryParse(String val, int defaultValue) { int v = defaultValue; try {/*from ww w. j ava2 s. com*/ v = Integer.parseInt(val); } catch (Exception e) { } return v; } }