title: How do i make a scanner so that I'm always able to input commands
body: <p>I'm making a movie store program and it is working very well when i input the first command but it doesn't let me input anymore commands.</p>
  
  <p>I think it is something to do with the String ChooseGenre=scan.next() but if i remove it my switch statement won't work since it doesn't take scanner variables.</p>
  
  <p>I want it so that i can input a command then be able to input another command.
  for example: i input "Action" and it gives me a list of action movies but then input "horror" and the output would be the list of horror movies.</p>
  
  <p>Here is my code</p>
  
  <pre><code>import java.util.Scanner;
  import java.util.concurrent.TimeUnit;
  import java.util.ArrayList;
  
  public class oiug {
  
  static Scanner scan = new Scanner(System.in);
  
  public static void main(String[] args) throws InterruptedException{
  
  
  
  
  
  
      // Start of the program
              ArrayList&lt;String&gt; Genre = new ArrayList&lt;String&gt;();
              Genre.add("Action");
              Genre.add("Horror");
  
              System.out.println("Welcome to the movie store Please type the genre of movie you would like to"
                      + " browse");                  
              Genre.forEach(System.out::println); 
  
  
  
      // ArrayList for the action movies
      ArrayList&lt;String&gt; Action = new ArrayList&lt;String&gt;();
      Action.add("Die Hard");
      Action.add("Top Gun");
      Action.add("Whitehouse Down");
      Action.add("The Gentlemen");
      Action.add("Mission impossible");
      Action.add("John Wick");
      Action.add("Atomic Blonde");
      Action.add("Inception");
      Action.add("The Matrix");
      Action.add("Speed");
  
      // ArrayList for the Horror movies
      ArrayList&lt;String&gt; Horror = new ArrayList&lt;String&gt;();
      Horror.add("Us");
      Horror.add("It Chapter 2");
      Horror.add("Get Out");
      Horror.add("The Interior");
      Horror.add("It follows");
      Horror.add("The Ring");
      Horror.add("The Shinning");
      Horror.add("Scream");
      Horror.add("Alien");
      Horror.add("Nightmare on Elm Street");
  
      ArrayList&lt;String&gt; Documentary = new ArrayList&lt;String&gt;();
      Documentary.add("Free Solo");
      Documentary.add("13th");
      Documentary.add("Fyre");
      Documentary.add("Honeyland");
      Documentary.add("Strong Island");
      Documentary.add("Abducted in plain sight");
      Documentary.add("Man on Wire");
      Documentary.add("How to Survive a Plague");
  
  
       String ChooseGenre=scan.next(); 
  
       System.out.println("Loading."); 
       TimeUnit.SECONDS.sleep(1);
       System.out.println("Loading.."); 
       TimeUnit.SECONDS.sleep(1);
       System.out.println("Loading..."); 
       TimeUnit.SECONDS.sleep(1);
  
       // If the input doesn't match one of the options a "please try again messege appears"
        switch(ChooseGenre) {
           case "Horror" :
              System.out.println("you chose: Horror!"); 
              Horror.forEach(System.out::println);
              break;
           case "Action" :
               System.out.println("you chose: Action!");
               Action.forEach(System.out::println);
              break;
           case "Documentary" :
               System.out.println("you chose: Documentary!");
               Documentary.forEach(System.out::println);
           default :
              System.out.println("Please enter a Movie genre");
        }
  
   } 
  
  
  
    }
  </code></pre>
  
  <p>I'm not exactly skilled at programming but ill take any help i can get</p>