Here you can find the source of toInt(Object obj)
public static int toInt(Object obj)
//package com.java2s; //License from project: Apache License public class Main { public static int toInt(Object obj) { int a = 0; try {/*w w w . j a va 2s . co m*/ if (obj != null) a = Integer.parseInt(obj.toString()); } catch (Exception e) { } return a; } public static String toString(Object obj) { if (obj == null) return ""; return obj.toString(); } }