title: Can't get the try-catch-finally block to work
body: <p>I have struggled a long time to get the try-catch-finally block to work. I'm a beginner in java, and are currently learning how to read/write/handle exceptions. In my task I'm trying to read from two separate .txt files. One has countries and population, the other has countries and the area of the country. This is further printed out to a new file where information about countries and area per person is displayed.</p>
  
  <p>I'm not sure if I really can put the finally inside a try-catch block. 
  Currently I'm getting the error message "Unhandled FileNotFoundException etc.". I've been trying this for for a long time now, and just can't get it to work properly. </p>
  
  <pre><code>    private String country;
  private double value;
  
  
  
  Scanner in1 = new Scanner(new File("countryPopulation.txt"));
  Scanner in2 = new Scanner(new File("countryArea.txt"));
  
  PrintWriter out = new PrintWriter("countryAreaPerInhabitant");
  
  public IOAndExceptionHandling(String line) {
      int i = 0;
      while (!Character.isDigit(line.charAt(i))) {
          i++;
      }
      this.country = line.substring(0, i - 1).trim();
      this.value = Double.parseDouble(line.substring(i).trim());
  }
  
  public String getCountry() {
      return this.country;
  }
  
  public double getValue() {
      return this.value;
  }
  
  public void printAreaPerPerson() {
      try {   
          try {
              while (in1.hasNextLine() &amp;&amp; in2.hasNextLine()) {
                  IOAndExceptionHandling country1 = new IOAndExceptionHandling(in1.nextLine());
                  IOAndExceptionHandling country2 = new IOAndExceptionHandling(in1.nextLine());                   
                  double density = 0;
                  if (country1.getCountry() == country2.getCountry()) {
                      density = country2.getValue() / country1.getValue();
                      out.println(country1.getCountry() + " : " + density);
                  }
              }
          }
          finally {
              in1.close();
              in2.close();
              out.close();
          }
      }
      catch (FileNotFoundException f) {
          System.out.println("FileNotFound!");
      }
      catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Thanks! :)</p>