title: Searching an ArrayList
body: <p>I'm a bit stuck on what to do after a certain part since making some of my code. It's supposed to put a text file through an ArrayList and then the user should have the ability to type a team name and it should add up how many times they pop up in the text file. But for the life of me I am stuck on how to proceed after what I have.</p>
  
  <pre><code> public static void main(String[] args) throws FileNotFoundException {
    ArrayList&lt;String&gt; mlb = new ArrayList&lt;String&gt;();
    Scanner fileReader = new Scanner(new File("WorldSeriesWinners.txt"));  // Declares the scanner to read from the file.      
    int Count = 0;
  
    Scanner keyboard = new Scanner(System.in);
    String userInput;
  
  
     while (fileReader.hasNext()){
         // While loop to continue to read while there is another line.
         mlb.add(fileReader.nextLine());
     }
     System.out.println("Enter a championship team you are looking up(1903-2009).");
     userInput = keyboard.nextLine();
  
     for(String team : mlb){ // Will run through the file and display the ArrayList.
         if(team.contains(userInput))
            System.out.println(team);
  </code></pre>