Here you can find the source of save(File f, T o)
public static <T> void save(File f, T o)
//package com.java2s; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; public class Main { public static <T> void save(File f, T o) { // TODO Auto-generated method stub ObjectOutputStream writer = null; try {//from w w w . j a v a 2 s. c om writer = new ObjectOutputStream(new FileOutputStream(f)); writer.writeObject(o); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { if (writer != null) { try { writer.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } }