public void write(Game g)
  {
  //FILL IN THE CODE:
    //Declare ObjectOutputStream object and set it to null
  	ObjectOutputStream out = null;

    try
    {
      //Instantiate ObjectOutputStream object using new FileInputStream object 
    	out = new ObjectOutputStream(new FileOutputStream(file));
      //  wrapped around file object (instance variable above)
      
      //Using writeObject() operation, write game object to file
    	out.writeObject(g);
    	
      try
      {
        //leave blank
      }
      finally  //Close stream if created
      {
        //if ObjectInputStream object isn't null
      	if(out != null)
      		out.close(); //  close ObjectInputStream
      }
 
    }
    catch (IOException e)
    {
      e.printStackTrace();
    	log.info(e.getCause().toString());
      JOptionPane.showMessageDialog(null, "Save failed:  IOException");
    }
  }