Here you can find the source of toInt(String s, int exception)
public static int toInt(String s, int exception)
//package com.java2s; public class Main { public static int toInt(String s) { return Integer.parseInt(s); }/*from w ww .j ava2s . c om*/ public static int toInt(String s, int exception) { try { return Integer.parseInt(s); } catch (NumberFormatException e) { return exception; } } }