题解代码:
package step1;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Task {
public void getCar(){
ApplicationContext app = new ClassPathXmlApplicationContext("applicationContext1.xml");
Car car = (Car)app.getBean("car");
car.run();
}
}