package com.ssm.di.constructor;


import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestDI {
public static void main(String[] args) {
    //1.初始化Spring容器，加载配置文件
    ApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean-di-constructor.xml");

    //获得Budget对象
    Budget budget = (Budget) applicationContext.getBean("budget");
    //输出Budget实例的信息
    System.out.println(budget.toString());

}
}
