I have this method:
public int index(String character)
{
String[] array = {"Apple", "Banana", "Apple", "Orange"};
return Integer.parseInt(array.indexOf(character));
}
And then:
testClass ind = new testClass();
for (loop probably here)
{
System.out.println(ind.index("Apple"));
}
And result should be:
0 2
But I don't know where I should put loop and what should be in loop. Without loop is result only first index id - in this case it would be 0.