Comparing | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Comparing

How to compare character array in Java?

26th Oct 2017, 5:03 PM
Shamanth Rai
Shamanth Rai - avatar
5 Answers
+ 4
Loop through the array and see if each element at the same index is equal to one another with ==.
26th Oct 2017, 6:58 PM
Rrestoring faith
Rrestoring faith - avatar
+ 2
The java.util.Arrays.equals(char[] a, char[] a2) method returns true if the two specified arrays of chars are equal to one another. Two arrays are equal if they contain the same elements in the same order. Two array references are considered equal if both are null.
26th Oct 2017, 5:06 PM
Shekhar Raha
0
How to check whether the specific character is greater or lesser? I don't want to check for equality. And thanks for your reply #Shekar Raha
26th Oct 2017, 5:08 PM
Shamanth Rai
Shamanth Rai - avatar
0
welcome @Shamanth Rai
27th Oct 2017, 12:41 AM
Shekhar Raha
0
Ordinary comparison doesn't work @Gordie
28th Oct 2017, 3:27 AM
Shamanth Rai
Shamanth Rai - avatar