Here you can find the source of toInt(String str)
public static int toInt(String str)
//package com.java2s; //License from project: Apache License public class Main { public static int toInt(String str) { if (str != null && !str.equals("")) { int value1; try { value1 = Integer.parseInt(str); } catch (Exception var3) { var3.printStackTrace(); value1 = 0;/*from w w w . j av a2s .c o m*/ } return value1; } else { return 0; } } public static boolean equals(String str1, String str2) { return str1 != null && !str1.equals("") && str2 != null && !str2.equals("") ? str1.equals(str2) : false; } }