public static boolean isJavaKeyword ( String key ) { int i = 0 ; int j = javaKeywords . length ; while ( i < j ) { int k = ( i + j ) / 2 ; int result = javaKeywords [ k ] . compareTo ( key ) ; if ( result == 0 ) { return true ; } if ( result < 0 ) { i = k + 1 ; } else { j = k ; } } return false ; }
Test whether the argument is a Java keyword