title: How to compare a word from a ArrayList to a word in a file?
body: <p>The program I'm creating is a 'spell check' kind of program but have been specifically told to have the dictionary words in a <code>ArrayList</code> and the file we are comparing the words in to be a .txt file.</p>
  
  <p>For the life of me I can not figure out how to compare them.</p>
  
  <p>This is what I've gotten so far(it doesn't have the compare loop since none of them even came close to working).</p>
  
  <pre><code>package testDelimeter;
  import java.io.File;
  import java.io.FileNotFoundException;
  import java.util.ArrayList;
  import java.util.Scanner;
  
  public class test {
  public static void main(String[] args) throws FileNotFoundException {
  
      ArrayList&lt;String&gt; dict = new ArrayList&lt;String&gt;();
  
  
      File  inFile = new File("C:\\Users\\Ceri\\workspace1\\testDelimeter\\src\\testDelimeter\\" + "dict" + ".txt");
      Scanner in = new Scanner(inFile);
  
      File  text = new File("C:\\Users\\Ceri\\workspace1\\testDelimeter\\src\\testDelimeter\\" + "text" + ".txt");
      Scanner s = new Scanner(text);
  
  
      while(in.hasNext()){
          dict.add(in.next());
      }
  
  
  }
  
  
  }
  </code></pre>
  
  <p>Guidance more than anything would be brilliant!</p>