I'm learning Java and I came across the need for the in
operator. For example:
I have a vector ( v = {1,2,3,4,6}
) and I want to see if the 5 is in this vector (not in this case).
In python it would be v = [1,2,3,4,6]
- 6 in v
, then it would return False
. I want to do this in Java, but do not find the operator that works.
How do I do this in java?