Unable to add strings into arrayList
<p>may i know why? i have passed in three strings to the addTab method and it is there in the variable when i debug but it says it is null why is that so? i have also instantiated the arrayList</p>

<pre><code>public class STFile implements Serializable{

    private ArrayList&lt;String&gt; qnsTitle;
    private ArrayList&lt;String&gt; qnsImagePath;
    private ArrayList&lt;String&gt; qnsSoundPath;
    private Boolean fileExist;
    //Constructor for STFile,gets existing data files if exists and load values from it to data files arraylists, if dont exist
    //arraylists for data file will be instantiated.

    public STFile()
    {
         setFileExists(checkIfAllFileExist());
         if(getFileExist())
         {
             try {
                setQnsTitle(STFile.readFile(STMain.TITLES_PATH));
                setQnsImagePath(STFile.readFile(STMain.IMAGES_PATH));
                setQnsSoundPath(STFile.readFile(STMain.SOUNDS_PATH));

            }catch(IOException e)
            {
                System.out.println("in class STFile, IOEXception");
            }catch(ClassNotFoundException e)
            {
                System.out.println("in class STFile, ClassNotFoundException");
            }
         }else
         {

             File titleFile = new File(STMain.TITLES_PATH);
             File imageFile = new File(STMain.IMAGES_PATH);
             File soundFile = new File(STMain.SOUNDS_PATH);
            qnsTitle = new ArrayList&lt;String&gt;();
            qnsImagePath = new ArrayList&lt;String&gt;();
            qnsSoundPath= new ArrayList&lt;String&gt;();
         }

    }

    public void addTab(String title,String imagePath,String soundPath)
    {
        getQnsTitle().add(title);
        getQnsImagePath().add(imagePath);
        getQnsSoundPath().add(soundPath);
        try {
            writeFiles();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            System.out.println("in STFile addtab Exception");
            e.printStackTrace();
        }
    }

public static ArrayList&lt;String&gt; readFile(String filePath) throws ClassNotFoundException, IOException
    {

                ArrayList&lt;String&gt; arraylist = new ArrayList&lt;String&gt;();
                ObjectInputStream obj_in = null;
                FileInputStream f_in = null;

                try {

                    f_in = new FileInputStream(filePath);
                    obj_in = new ObjectInputStream (f_in);
                    arraylist = (ArrayList&lt;String&gt;)obj_in.readObject();
                    return arraylist;
                }catch(Exception e){
                    return null;
                }finally{
                    f_in.close();
                    obj_in.close();
                    return null;
                }

    }
</code></pre>

<p>main method.</p>

<pre><code>STFile file = new STFile();
    file.addTab("Title", "image", "sound");
</code></pre>

<p>it keeps throwing </p>

<pre><code>Exception in thread "main" java.lang.NullPointerException
    at STFile.addTab(STFile.java:53)
    at STMain.main(STMain.java:18)
</code></pre>
