import java.io.*;
import java.util.*;
class PropertiesDemo
{
public static void main(String[] args) throws IOException
{
// Properties prop = System.getProperties();//new Properties();
// prop.setProperty("01","zhangsan");
// prop.setProperty("02","lisi");
// prop.list(new PrintStream("sys.txt"));
// infoToProp();
Properties prop = new Properties();
FileInputStream fis = new FileInputStream("info.txt");
prop.load(fis);
prop.setProperty("lisi","29");
FileOutputStream fos = new FileOutputStream("info.txt");
prop.store(fos,"hahha");
// System.out.println(prop.getProperty("wangwu"));
fos.close();
fis.close();
}
public static void infoToProp()throws IOException
{
Properties prop = new Properties();
BufferedReader bufr =
new BufferedReader(new FileReader("info.txt"));
String line = null;
while((line=bufr.readLine())!=null)
{
// System.out.println(line);
String[] arr = line.split("=");
prop.setProperty(arr[0],arr[1]);
}
System.out.println(prop.getProperty("lisi"));
bufr.close();
}
}