I have created a method for my program, where I compare two arrays, user and test. I am trying to add the index of the array user into the ArrayList qMissed when it is not the same as the test Array. If both arrays are the exact same then it should just return null. I am getting exception errors because I need to complete the reference type but I am unsure of what to do.
/**
* @param user
* @param test
* @return
*/
public static ArrayList<String> questionMissed(String[] user, String[] test)
{
ArrayList<int> qMissed = new ArrayList<int>();
for (int i = 0; i <= user.length-1; i++)
{
if (user[i] != test[i])
{
qMissed = Arrays.asList(qMissed).indexOf(user);(i+1);
}
else if (user[i] == test[i])
{
return null;
}
}
return qMissed;
}