Java文件
public class Test {
public static void main(String[] args) throws IOException,InstantiationException, IllegalAccessException, ClassNotFoundException {
Properties pros=new Properties();
pros.load(Test.class.getClassLoader().getResourceAsStream("com/ygl/spring/factory/spring.properties"));
String vehicleType=pros.getProperty("VehicleType");
Object o=Class.forName(vehicleType).newInstance();
Move m=(Move)o;
m.run();
}
}