Java GuardedObject read
import java.io.FileInputStream; import java.io.ObjectInputStream; import java.security.GuardedObject; public class Main { public static void main(String[] args) throws Exception { ObjectInputStream ois = new ObjectInputStream(new FileInputStream("pass")); GuardedObject go = (GuardedObject) ois.readObject(); String pass = (String) go.getObject(); System.out.println("pass = " + pass); }// w w w .j a va2s.c om }