For an array, how can i take all the values at even indexes and add to nameArray and all the values at odd indexes and add to scoreArray? I got this code but it isn't working.
String[] inputArray = {"john", "10", "frank", "14"}
for (int j = 0; j == inputArray.length; j++) {
if ((j % 2) == 0) {
nameArr.add(inputArray[j]);
} else {
scoreArr.add(inputArray[j]);
}
}