import java.io.*;
public class filesExample
{
    public static void main (String args[])
    {
	new filesExample ();
    }


    public filesExample ()
    { //How to call your methods
	save ();
	open ();
    }


    public void save ()
    {
	PrintWriter out;
	try
	{
	    out = new PrintWriter (new FileWriter ("scores.txt"));
	    //----To Do: Adapt to save in YOUR data -------------
	    out.println ("output");
	    //---------------------------------------------------
	    out.close ();
	}
	catch (IOException e)
	{
	    System.out.println ("Error opening file " + e);
	}
    }



    public void open ()
    {
	BufferedReader in;
	try
	{
	    in = new BufferedReader (new FileReader ("scores.txt"));
	    //----To Do: Adapt to read in YOUR data -------------
	    String next = in.readLine ();
	    System.out.println (next);
	    //---------------------------------------------------
	    in.close ();

	}
	catch (IOException e)
	{
	    System.out.println ("Error opening file " + e);
	}
    }
}


