title: creates the file doesnt write java
body: <pre><code>public static void main(String[] args) throws FileNotFoundException {
  
          @SuppressWarnings("unused")
          Scanner in = new Scanner(System.in);
          System.out.println("enter filename");
          Filename=in.next();
          PrintWriter outputFile  =new PrintWriter(Filename);
          outputFile.println();
          outputFile.close();
          getInput();
          display();
  
      }
  
      public static void display() throws FileNotFoundException{
          for (int i = 0; i &lt; genders.length; i++) {
              System.out.println(ages[i]+";"+genders[i]+";"+emails[i]+";"+salaries[i]);
      }}
  
  
      public static void getInput(){
  
          System.out.print("How many users do you wish to enter: ");
          int num = in.nextInt();
          ages= new int[num];
          genders = new String[num];
          emails = new String[num];
          salaries = new double[num];
  
          for (int i = 0; i &lt; num; i++) {
              System.out.print("Please enter your age for person "+(i+1)+": ");
              ages[i] = in.nextInt();
              while (ages[i]&lt;20 ||ages[i]&gt;30){
                  System.out.println("invalid age please re enter again");
                  ages[i] = in.nextInt();}
              in.nextLine();
  </code></pre>
  
  <p>hey guys i am trying to write the contents of user input into a file. my problem is it creates the file but doesnt write to it. i have tried various methods but doesnt work any help?</p>