All pastes #31117 Raw Edit

Mine

public java v1 · immutable
#31117 ·published 2005-11-25 05:07 UTC
rendered paste body
public someClass{    public myClass implements Runnable, Serializable    {        public void run()        {            // Do something...        }    }    protected synchronized void saveData(Object myObject)    {        File file = new File("relative/path/to/file.ext");        file.createNewFile();        FileOutputStream fos = new FileOutputStream(file);        ObjectOutputStream oos = new ObjectOutputStream(fos);        oos.writeObject(myObject);        oos.close();        fos.close();    }    public someClass()    {        myClass test = new myClass();        saveData(test);    }}