public class Main { public static void main(String[] args) throws IOException { //创建Properties对象 Properties prop = new Properties(); //读取classPath中的properties文件 prop.load(Main.class.getClassLoader().getResourceAsStream("bean.properties")); //根据键
import java.io.EOFException;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.IOException;import java.io.ObjectInputStream; public class Main { /***ObjectInputStream 使用示例*/public void readPersons(String filename) { Ob
SharedPreferences保存和读取对象 1.首先要序列化对象(以下是序列化实体类的样例,不方便贴出实体类全部的代码) public class LoginResult extends BaseResult implements Serializable{ private static final long serialVersionUID = 1L; private String mobiletoken; 2.保存和读取对象的封装 public class ObjectSaveUtil