How to Compare Character in Java - Scaler Topics
Using Relational Operators. In Java, we can compare characters by using relational operators such as <, >, or =. It is possible to compare only primitive characters with this method. In the example below, two characters are compared using relational operators in Java. There are no classes or methods involved in this method, making it the simplest.