J
jbj
How can I validate that one string array is equal to another? I was
hoping to get a quick one line of code result, but alas, it is not
working. I tried both equality operators and their hashcodes:
Code:
_____________________________________________
String one1[] = {"hi","you"};
String one3[] = {"hi","you"};
System.out.println(one1.hashCode());
System.out.println(one3.hashCode());
System.out.println(one3==one1);
______________________________________________
With this result:
______________________________________________
17237886
8187137
false
______________________________________________
The big issue with this is that I will actually eventually be using a
double array ( a matrix if you will) of strings, so even more code
would be used. Let me know if there is a quick way to get around
this.
j
hoping to get a quick one line of code result, but alas, it is not
working. I tried both equality operators and their hashcodes:
Code:
_____________________________________________
String one1[] = {"hi","you"};
String one3[] = {"hi","you"};
System.out.println(one1.hashCode());
System.out.println(one3.hashCode());
System.out.println(one3==one1);
______________________________________________
With this result:
______________________________________________
17237886
8187137
false
______________________________________________
The big issue with this is that I will actually eventually be using a
double array ( a matrix if you will) of strings, so even more code
would be used. Let me know if there is a quick way to get around
this.
j