Java Character isJavaIdentifierstart() MethodThe isJavaIdentifierStart(char ch) method of Character class determines whether the given(or specified) character is considered as the first character in a Java identifier or not. A character may start a Java identifier if and only if any of the following conditions is true:
Note: The above method cannot be used to handle supplementary characters. In order to support all the Unicode characters, including all the supplementary character, we can use the isJavaIdentifierStart(int) method.SyntaxParameterch: It is the character that needs to be tested. Return ValueThe isJavaIdentifierStart(char ch) method returns a Boolean value i.e. true if the given(or specified) character may start a particular Java identifier. Otherwise, the method returns false. Example 1Output: The first character may start a Java identifier: false The second character may start a Java identifier: false The third character may start a Java identifier: true Example 2Output: The first character may start a Java identifier: true The second character may start a Java identifier: true The third character may start a Java identifier: true Example 3Output: Enter the first character:) The first input ')' may not start a Java identifier. Enter the second character:k The second input 'k' may not start a Java identifier. |