1 d arrays ::: output to a file


import java.io.*;
import java.util.*;

public class WritetoFile
{
  public static void main (String[] args) throws IOException
  {
    BufferedReader readObject=new BufferedReader(new FileReader ("scores.txt"));
   
    PrintWriter writeObject=new PrintWriter(new FileWriter ("boo.txt")); 
      
    String scores = readObject.readLine (); 
    
    while (scores != null) 
    {
      writeObject.println (scores);//writing to the file
      scores = readObject.readLine ();//read the next score
    }
    
    readObject.close ();
    writeObject.close ();//must close the write file
    
  }
}