<gouthampradhan>string_CompareVersionNumbers_1.java
public int compareVersion(String version1, String version2) {
    StringTokenizer st1 = new StringTokenizer(version1, ".");
    StringTokenizer st2 = new StringTokenizer(version2, ".");
    while (st1.hasMoreTokens() & st2.hasMoreTokens()) {
      int token1 = Integer.parseInt(st1.nextToken());
      int token2 = Integer.parseInt(st2.nextToken());
      if (token1 > token2) return 1;
      else if (token2 > token1) return -1;
    }
    if (st1.countTokens() > st2.countTokens()) {
      while (st1.hasMoreTokens()) {
        if (Integer.parseInt(st1.nextToken()) > 0) return 1;
      }
    } else if (st2.countTokens() > st1.countTokens()) {
      while (st2.hasMoreTokens()) {
        if (Integer.parseInt(st2.nextToken()) > 0) return -1;
      }
    }
    return 0;
  }
public int sample_funcname ( String var_1 , String var_2 ) {
  StringTokenizer var_5 = new StringTokenizer ( var_1 , "." ) ;
  StringTokenizer var_6 = new StringTokenizer ( var_2 , "." ) ;
  while ( var_5 . hasMoreTokens ( ) & var_6 . hasMoreTokens ( ) ) {
    int var_11 = Integer . parseInt ( var_5 . nextToken ( ) ) ;
    int var_12 = Integer . parseInt ( var_6 . nextToken ( ) ) ;
    if ( var_11 > var_12 ) return 1 ;
    else if ( var_12 > var_11 ) return - 1 ;
  }
  if ( var_5 . countTokens ( ) > var_6 . countTokens ( ) ) {
    while ( var_5 . hasMoreTokens ( ) ) {
      if ( Integer . parseInt ( var_5 . nextToken ( ) ) > 0 ) return 1 ;
    }
  }
  else if ( var_6 . countTokens ( ) > var_5 . countTokens ( ) ) {
    while ( var_6 . hasMoreTokens ( ) ) {
      if ( Integer . parseInt ( var_6 . nextToken ( ) ) > 0 ) return - 1 ;
    }
  }
  return 0 ;
}
