嗯,我从来没有想过我会需要编程时,走这么远,但我坚持..的Java - 错误而试图获得一些属性
我建立某种形式的引擎的东西,我需要建立,我得到一个“预期”的错误..
它使我疯狂,因为所有的来源是正确的(至少我认为是这样)。
源:在方法主体
import java.util.*;
import java.io.*;
public class Configurations {
// Storing the file locations in Strings.
public static String MOVE_FILE = "./configs/movement.properties";
// Creating the needed variables for working-out stuff.
public static String HELLO_WORLD;
// Reading certain properties file and getting parameters.
Properties Props = new Properties(); // Asks me to put { { here..
try {
Props.load(new FileInputStream(MOVE_FILE));
HELLO_WORLD = Props.getProperty("MSG", "HelloWorld");
} catch (IOException e) {
System.out.println(e);
}
} // tells me to put }; } here..
上面的代码不会编译。这是问题吗?你得到的预期错误是什么?我确定它包含一条有用的消息。读它可能是一个好主意。 – 2012-07-23 10:06:25