Here you can find the source of atoi(final String str, final int def)
public static int atoi(final String str, final int def)
//package com.java2s; public class Main { public static int atoi(final String str, final int def) { try {/* ww w.j av a 2 s .c o m*/ return Integer.parseInt(str); } catch (final Exception ex) { ex.printStackTrace(); } return def; } }