Java tutorial
//package com.java2s; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; public class Main { public static void SerializeObject(Object object, String path) throws IOException { ObjectOutputStream oo = new ObjectOutputStream(new FileOutputStream(new File(path))); oo.writeObject(object); oo.close(); } }