在JAVA上加载属​​性文件的最佳方法是什么

Mig*_*hez -2 java properties file

可能重复:
在java中读取属性文件的最佳方法?

我想知道在JAVA上加载.propertie文件的最佳方法是什么,我在这里环顾四周但是找不到我看的东西.这是加载它的最佳方法.我将它用于游戏开发.

此致,Migue

PKe*_*del 7

那个怎么样?

Properties properties = new Properties();
BufferedInputStream stream = new BufferedInputStream(new FileInputStream("example.properties"));
properties.load(stream);
stream.close();
String sprache = properties.getProperty("lang");
Run Code Online (Sandbox Code Playgroud)