public static boolean isJavaValidName(String str){
  if (str.isEmpty())   return false;
  if (javaKeys.contains(str))   return false;
  char first=str.charAt(0);
  if (isValidNameStartChar(first)) {
    for (int i=1; i < str.length(); ++i) {
      char c=str.charAt(i);
      if (!isValidNameChar(c))       return false;
    }
    return true;
  }
 else {
    return false;
  }
}

public static boolean isJavaValidName ( String str ) { if ( str . isEmpty ( ) ) return false ; if ( javaKeys . contains ( str ) ) return false ; char first = str . charAt ( 0 ) ; if ( isValidNameStartChar ( first ) ) { for ( int i = 1 ; i < str . length ( ) ; ++ i ) { char c = str . charAt ( i ) ; if ( ! isValidNameChar ( c ) ) return false ; } return true ; } else { return false ; } }
check whether the given string can be a valid java name
