title: How to write a reverse line program with recursion?
body: <p>I'm learning recursion and am having problems writing a 'simple' program. Help would be appreciated. Thanks!The code compiles with no syntax erros but i still cant use it to serve its purpose.</p>
  
  <p>my <em>updated</em> code:</p>
  
  <pre><code>    import java.io.*;
  import java.util.*;
  class recursion1
  {
      static Scanner inFile = null;
      public static void main(String[] args) throws IOException
      {
          try
          {
              inFile = new Scanner(new File(args[0]));
          }
          catch (IOException e)
          {
              System.out.println("File may not exist");
          }
          reverse(inFile);
          inFile.close();
      }
      public static void reverse(File inFile) throws IOException
      {
          String line = inFile.nextLine();
          if (inFile.hasNextLine())
          {
              reverse(inFile);
          }
          System.out.println(line);
      }
  }
  </code></pre>