I have been searching here for some time but haven't been able to find the answer to it.

I am basically required to use an array for this assignment from college. And then I am supposed to check that the input (which is also a String) matches whatever's stored within the String array.

I know one can easily compare Strings by using the .equals() method. However, the same method is not working with the String array.

I created the following example of code for the purpose of StackOverflow so you can use it to explain it to me, if you'd like.

What am I doing wrong?

```
import java.util.Scanner;

class IdiocyCentral {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        /*Prints out the welcome message at the top of the screen*/
        System.out.printf("%55s", "**WELCOME TO IDIOCY CENTRAL**\n");
        System.out.printf("%55s", "=================================\n");

        String [] codes = {"G22", "K13", "I30", "S20"};

        System.out.printf("%5s%5s%5s%5s\n", codes[0], codes[1], codes[2], codes[3]);
        System.out.printf("Enter one of the above!\n");

        String usercode = in.nextLine();

        if (codes.equals(usercode)) {
            System.out.printf("What's the matter with you?\n");
        }
        else {
            System.out.printf("Youda man!");
        }

    }
}

```

I apologize if this has been asked before and I just missed it, if its a double question, I will remove it.