i'm testing some Java 8 stream operations right now and i'm confused about following behaviour.
Having this simple test:
public static void main(final String[] args) {
final String[] arr = { "-e", "-f", "-t" };
System.out.println(Arrays.stream(arr).anyMatch(x -> x == "-e"));
}
That works fine as results in an expected "true". But, if i try match the "args" list instead the arr-array with content "-e" it won't work as expected and results in "false".
Strange, hmm?
Can anybody tell me whats wrong?