public static int tryParseInt(String toParse,String defaultValue){
  int result;
  try {
    result=Integer.parseInt(toParse);
  }
 catch (  NumberFormatException ex) {
    result=Integer.parseInt(defaultValue);
  }
  return result;
}

public static int tryParseInt ( String toParse , String defaultValue ) { int result ; try { result = Integer . parseInt ( toParse ) ; } catch ( NumberFormatException ex ) { result = Integer . parseInt ( defaultValue ) ; } return result ; }
similar to the c # int . tryparse where you pass in a string and if no good it will use the default value which is also parsed . . . which seems odd now i think about it todo investigate if the second argument could be an int
