Sorry, I'm a Java noob. Any idea why my code isn't compiling? I would like it to work such that I can enter two arrays at the command line, and have them used by the "findNa" method. If elements in the array match I would like NA to be printed on a new line, if there is no match I would like the original value in "array" to be printed. Thanks in advance!
class naFam {
static void findNa(String[] array, String[] lookupArray) {
int i;
int j;
for (i = 0; i < array.length; i++) {
for (j = 0; j < lookupArray.length; j++) {
if (array[i] == lookupArray[j]) {
System.out.println("NA");
} else {
System.out.println(array[i]);
}
}
}
}
public static void main(String args[]) {
String[] array = args[0];
String[] lookupArray = args[1];
findNa(array, lookupArray);
}
}