I have been working on and off with Java/Python. Now in this situation I want to check if the element is in the list and do stuff…
Python says:
if "a" in ["a", "b", "c"]:
print "It's there!"
Does Java provide any one liner for this rather than creating ArrayList / Set or similar data structure in steps and adding elements to it?
Thanks.
Use
Arrays.asList: