public static int tryParseInt(String intString,int defaultValue){
  try {
    return Integer.parseInt(intString);
  }
 catch (  NumberFormatException e) {
    return defaultValue;
  }
}

public static int tryParseInt ( String intString , int defaultValue ) { try { return Integer . parseInt ( intString ) ; } catch ( NumberFormatException e ) { return defaultValue ; } }
try to parse int string , returning - 1 if it fails .
