title: Writing System.Out.Println into text file
body: <p>I need to write those System.out.printlns into a text file, but I have no idea how this could happen so I need some help from someone advanced.</p>
  
  <pre><code>  System.out.println("You have have entered "+EnteredNumbers+ " numbers!");
    System.out.println("You have have entered "+Positive+ " Positive numbers!");
    System.out.println("The Average of the Positive Numebers is "+AveragePositive+ "!");
    System.out.println("You have have entered "+Negative+ " Negative numbers!");
    System.out.println("The Sum of the Negative numbers is "+NegativeSum+ "!");
  </code></pre>
  
  <p>And here is the whole code:</p>
  
  <pre><code>import java.io.*; 
  
  public class Nums { 
    public static void main(String args[]) 
      throws IOException 
    { 
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 
      String str;
      int EnteredNumbers = -1;
      int Positive = 0;
      int Negative = 0;
      int NegativeSum = 0;
      int PositiveSum = 0; 
      double AveragePositive = 0;
  
      System.out.println("Enter '0' to quit."); 
      System.out.println("Enter Numbers: "); 
     try{
      do { 
        EnteredNumbers++;
        str = br.readLine();
        int num = Integer.parseInt(str);
        if (num&gt;0)
        {
          Positive++;
          PositiveSum+=num;
        }
        else if (num&lt;0)
        {
          Negative++;
          NegativeSum+=num;
        }
         } 
      while(!str.equals("0")); 
        AveragePositive = (double)PositiveSum/(double)Positive;  
        System.out.println("You have have entered "+EnteredNumbers+ " numbers!");
        System.out.println("You have have entered "+Positive+ " Positive numbers!");
        System.out.println("The Average of the Positive Numebers is "+AveragePositive+ "!");
        System.out.println("You have have entered "+Negative+ " Negative numbers!");
        System.out.println("The Sum of the Negative numbers is "+NegativeSum+ "!");
  
        }
      catch (java.lang.NumberFormatException ex)
      {
          System.out.println("Invalid Format!");
      }  
  } 
  }
  </code></pre>
  
  <p>I am a beginner and I would love to get some help! </p>