ane4ka
asked on
Comparinf values in array in java
hello,
How do I compare values within two array in java.
Let's say we have the following two lists od strings:
["a", "b", "d"]
["a", "b", "c", "e"]
There could be 3 conditions:
1. Value could be in two arrays (ex. a,b)
2. Value could be only in first aray (ex. d)
3. Value could be only in second array. (ex. c,e)
I need to identify one of the three conditions for each value in both array. How can I doi tprogramaticly in java.
Thanks in advance!
How do I compare values within two array in java.
Let's say we have the following two lists od strings:
["a", "b", "d"]
["a", "b", "c", "e"]
There could be 3 conditions:
1. Value could be in two arrays (ex. a,b)
2. Value could be only in first aray (ex. d)
3. Value could be only in second array. (ex. c,e)
I need to identify one of the three conditions for each value in both array. How can I doi tprogramaticly in java.
Thanks in advance!
Add each to a Set and then do retainAll , etc on them
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm not that pI'm not that proficient in Java. Can you please be more specific and give some code examples.
Thanks for the quick reponse.
Thanks for the quick reponse.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.