Java-Comparing Length

Comparing Length It should be carefully noted here equals( ), equalsIgnoreCase( ) methods enable us to check whether two strings are identical or not. However, in some situations, we may wish to test whether one string is greater than, equal to or less than another string. The compareTo( ) method of the String class is … Read more…

Java-String Comparison

String Comparison We use the == operator for comparing the values of two variables or expressions of any data type, such as int, float, double, char and boolean. But we have to use the equals( ) method of the String class for comparing two strings. This method is used to find the contents are same, … Read more…