Java Character equals() MethodThe equals(Object obj) method of character class compares the object with the specified object. The result is true if and only if the argument is not null and the Character object has the same char value as represented by the object. SyntaxParameterThe above method requires only one parameter: The object that needs to be compared. Return ValueThe equals(Object obj) method returns true if the objects are same. Otherwise, the method returns false. Example 1Output: They are equal. Example 2Output: They are not equal. Example 3Output: The numbers are equal. Example 4Output: The numbers are not equal. Next TopicJava-character-fordigit-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