此程序把数据保存到count.txt文件里时,这句Count=中的“=”号是如何生成的?
程序如下:import java.util.*;
import java.io.*;
class PropertiesFile
{
public static void main(String [] args)
{
Properties settings=new Properties();
try
{
settings.load(new FileInputStream("c:\\count.txt"));
}
catch(Exception e)
{
settings.setProperty("Count",new Integer(0).toString());
}
int c=Integer.parseInt(settings.getProperty("Count"))+1;
System.out.println("这是本程序第"+c+"次被使用");
settings.put("Count",new Integer(c).toString());
try
{
settings.store(new FileOutputStream("c:\\count.txt"),"This Program is used:");
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}
}
程序执行3次后count.txt的内容如下:
#This Program is used:
#Fri Mar 03 05:29:16 CST 2006
Count=3//这句中的“=”号是怎么得出的?
谢谢!!
[此贴子已经被作者于2006-3-3 7:31:06编辑过]