Here you can find the source of load(File file)
public static Object load(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.ObjectInputStream; public class Main { public static Object load(File file) { Object o = null;/*www. j a v a 2s. co m*/ try { ObjectInputStream s = new ObjectInputStream(new FileInputStream(file)); o = s.readObject(); s.close(); } catch (IOException | ClassNotFoundException e) { e.printStackTrace(); } return o; } }