Scan and perform action 5 times
Hi, I have an array with 5 elements String[] names= {"vin","gold","bop","test","face"}; Now I want to check the array element from 0 to 4 against a list. It could be an array list or linked list. Example: LinkedList<String> linkedlist= new LinkedList<String>(); linkedlist.add("gold"); linkedlist.add("test"); linkedlist.add("vin"); linkedlist.add("fsce"); linkedlist.add("test"); linkedlist.add("become"); So now I want to use a while loop to check each array element one by one from 0 to 4. If element from index 0 matches I want to use the if statement and perform an action. Then the while loop go back again and check index 1, do the same thing until the last element on index 4. How do I do that?