我需要读取一个属性文件并在Java中生成一个Properties类.我这样做是通过使用:
Properties props = new Properties();
props.load(new FileInputStream(args[0]));
for (Enumeration e = props.propertyNames(); e.hasMoreElements();) {
}
Run Code Online (Sandbox Code Playgroud)
但是,props.propertyName返回的属性不是原始属性文件的顺序.我知道属性只是老式的,非泛化的Hashtables.我正在寻找一个解决方案.任何的想法?谢谢!