title: java: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
body: <p>Why am I getting a "must be caught or declared to be thrown" error with this code ? All I want is to test a bunch of code by pasting it into a new java program what is the easiest way to bunch of code ?</p>
  
  <pre><code>import java.io.File;
  import java.io.PrintWriter;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.Scanner;
  
  public class Main {
  
      public static void main(String[] args) {
  
          Scanner sc = new Scanner(new File("C:\\Users\\User\\Selenium\\scrapjv\\interface\\NASDAQlist.txt"));
          List&lt;String&gt; symbolList = new ArrayList&lt;String&gt;();
          while (sc.hasNextLine()) {
              symbolList.add(sc.nextLine());
          }
  
          PrintWriter logput = new PrintWriter("C:\\Users\\User\\Selenium\\scrapjv\\interface\\log.txt", "UTF-8");
          for (String symb : symbolList) {
              System.out.println(symb);
          }
          logput.close();
      }
  }
  </code></pre>