Java Character compare() MethodThe compare(char x, char y) method of Character class is used to compare two char values numerically. The final value returned is similar to what would be returned by: SyntaxParameterThe above method requires two parameters:
Return ValueThe compare(char x, char y) method of character class returns
Example 1Output: First value is less than the second value. Example 2Output: Value 1 is greater than the value 2. Example 3Output: First and second values are equal. First value is less than the third value. Next TopicJava-character-compareto-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India