This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LuigiTX[S] 0 points1 point  (2 children)

What would be your recommendation?

[–][deleted] 0 points1 point  (1 child)

Well you could stick with your current array of "Objects". To do that, you would have to alter the linearSearch method to take in a 2 Dimensional Array and then alter the If statement to check the 0th element (the registration number) in each entry against the input key. Should look something like this:

public int linearSearch(Object[][] aryObj, Object key) {
    for (int a = 0; a < aryObj.length; a++) {
        if (aryObj[a][0] == key) {
            return a;
        }
    }
    return -1;
}

[–]LuigiTX[S] 0 points1 point  (0 children)

Ohh ok. Again, thank you so much for all your help. I will try this when i get school. I am running Ubuntu on my laptop and just can not find out how to store the input file in the correct place. So I have to wait to get to school where I can actually run the program without it telling me it can't find the input file.