The Character.isJavaIdentifierStart(int codePoint) is an inbuilt method in java that determines if the character (Unicode code point) is permissible as the first character in a Java identifier. It is to be noted that a character may start a Java identifier if and only if one of the following conditions is true:
- isLetter(ch) returns true
- getType(ch) returns LETTER_NUMBER
- ch is a currency symbol (such as ‘$’)
- ch is a connecting punctuation character (such as ‘_’).
public static boolean isJavaIdentifierStart(int codePoint)
Parameters: The parameter codePoint is of the integer type and refers to the character (Unicode code point) that is to be tested.
Return value: The isJavaIdentifierStart(int codePoint) method of Character class returns true if the character may start a Java identifier; false otherwise.
Below programs illustrate the Character.isJavaIdentifierStart() method:
c1 may start a Java identifier is false c2 may start a Java identifier is true c3 may start a Java identifier is false
c1 may start a Java identifier is false c2 may start a Java identifier is true
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.