@Override
    public void writeToFile(String pathOfFile, Object[] objects, boolean addToEndOfFile, int typeOfFile) 
    {
        File fileData = new File(pathOfFile);
        String errorMsg = null;
        
        if(typeOfFile == 1)
        {
            try 
            {
            PrintWriter out = new PrintWriter(new BufferedWriter(new java.io.FileWriter(pathOfFile, addToEndOfFile)));

            StringBuffer stringBuffer = new StringBuffer();

                for(int i = 0; i < objects.length; i++)
                {
                    if(i == (objects.length - 1))
                    {
                    stringBuffer.append(objects[i]);
                    }
                    else
                    {
                    stringBuffer.append(objects[i]).append("\n");
                    }
                }

            out.println( stringBuffer.toString() );
            out.close();
            }
            catch(IOException ioe)
            {
                errorMsg = ioe.getMessage();
                System.out.println("Unable to write to file!");
            }
        }
        else
        {
            System.out.println("Incorrect file type!");
        }
    }