Searching about element in ArrayLists "JAVA"
Posted on 2006-07-11
If I have two arrayLists, and I want to search if first element in myArrayList is there in yourArrayList, if it is found return true and false otherwise;
I have problem in my code which looping in returning values. So, if it the element not found then it will looping returning false, and I want only one return value, either true or false.
public static boolean isThere(ArrayList myArrayList,ArrayList yourArrayList)
for(int k = 0;k <= yourArrayList.size();k++)