title: Error trying to save file with java
body: <p>I'm making a Memory calculator that can save the memory to a file but I keep getting "File not found" Please Help!
  Here's the Saving Memory Calculator that extends from my Memory Calculator:</p>
  
  <pre><code>import java.io.File;
  import java.io.FileNotFoundException;
  import java.io.PrintWriter;
  import java.util.Scanner;
  
  
  
  class SaveSciMemCalc extends SciMemCalc {
  
  public int displayMenu(){
  
      @SuppressWarnings("resource")
      Scanner input = new Scanner(System.in);
      int choice = -1;
      while (choice &lt; 1|| choice &gt; 8){
          System.out.println();
          System.out.println("Menu:");
          System.out.println("1. Add");
          System.out.println("2. Subtract");
          System.out.println("3. Multiply");
          System.out.println("4. Divide");
          System.out.println("5. Power");
          System.out.println("6. Logarithm");
          System.out.println("7. Clear");
          System.out.println("8. Save");
          System.out.println("9. Quit");
          System.out.println();
          System.out.println("What would you like to do?");
      choice = input.nextInt();
      if (choice &lt; 1|| choice &gt; 9){
          System.out.println(choice +" wasn't one of the options");
      }
      if (choice == 9){
          System.out.println("Thank you, good bye!");
          System.exit(0);
      }
      }
      return choice;
  }
  String save(String saveList) throws FileNotFoundException{
      setCurrentValue(0);
      File dir = new File(saveList);
      PrintWriter pw = new PrintWriter(dir);
      pw.println(dir);
      pw.close();
      return "Saving...";
  }
  
  }
  </code></pre>
  
  <p>And here's the driver class I made to run the calculator:</p>
  
  <pre><code>import java.io.FileNotFoundException;
  import java.util.Arrays;
  
  
  
  
  public class SaveSciMemCalcDriver {
  
  public static void main(String[] args) {
      String dog = "";
      SaveSciMemCalc calc = new SaveSciMemCalc();
      int p = 0;
      String[] saves = new String[10];
      while (true){
  
          System.out.println("The current value is " + calc.getCurrentValue());
  
          double currentValue = calc.getCurrentValue();
  
          int choice = calc.displayMenu();
  
          double second = 0;
          String o = null;
          if (choice &lt; 6) {
              second = calc.getOperand("What is the second number? ");
          }
  
          if (choice == 1) {
              calc.add(second);
              o = " + ";
          } else if (choice == 2){
              calc.subtract(second);
              o = " - ";
          } else if (choice == 3){
              calc.multiply(second);
              o = " * ";
          } else if (choice == 4){
              calc.divide(second);
              o = " / ";
          } else if (choice == 5){
              calc.power(second);
              o = " ^ ";
          } else if (choice == 6){
              calc.log();
              o = "log";
          } else if (choice == 7){
              calc.clear();
              Arrays.fill(saves, null);
          } else if (choice == 8){
              for (int i=0;i&lt;saves.length;i++){
                  dog=dog+saves[i]+"\n";
              }
              try {
                  calc.save(dog);
              } catch (FileNotFoundException e) {
                  e.printStackTrace();
              }
              Arrays.fill(saves, null);
          }
          if (choice == 6){
              saves[p] = o+currentValue+" = "+calc.getCurrentValue();
          }else{
              saves[p] = currentValue+o+second+" = "+calc.getCurrentValue();
          }
      p++;
      if (choice == 7){
          p=0;
      if(choice == 8){
          p=0;
      }
      }
  }
  }
  }
  </code></pre>