How to validate a string user's input against an string array in Java : <p>I have been asked to prompt the user for a string data and then validate the user input against an array of the data containing the values that the user should enter and prompt the user is the string is not valid. </p>

<pre><code> public static void main(String[] args)
 {
    Scanner keyboard = new Scanner(System.in);

    //List of values the user suppose to enter

   String[] list = {"Monday","Thusday", "Wednesday", "Thusday", 
                   "Friday", "Saturday", "Sunday"}


     System.out.println("Enter a day:"\n Eg: Monday or Thursday")
     String day = keyboard.next();

 /**
   What should I write so that I can validate the user input against an
   string array of days? And prompt the user again if his input is not 
   a day.

 */

}
</code></pre>
