prop = new Properties();
try{
prop = new Properties();
prop.load(new FileReader(BasicFactory.class.getClassLoader().getResource("config.properties").getPath()));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
load报错,说The method had Inputstream in the type properties is not applicable for the arguments (Filereader) .
求解决方法
先用文件路径new 一个File 然后再传给FileReader