public class Singleton {
public Serialize(Object object, String filename) throws IOException
{
FileOutputStream out=new FileOutputStream(filename, true);
ObjectOutputStream oos=new ObjectOutputStream(out);
oos.writeObject(object);
out.close();
}
}
I have created this java class for project. I want to recode this class accorfing to singleton design pattern. Can somebody tell me how to do it? as far as i know it should be a private right? and what should be the different?
Aucun commentaire:
Enregistrer un commentaire