首页>代码>spring基于xml文件配置实现初始化bean的实例>/spring-xml-based-configuration-example/src/main/java/com/memorynotfound/spring/Run.java
package com.memorynotfound.spring;

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

public class Run {

    public static void main(String... args){
        ApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"app-config.xml"});
        CoffeeMachine coffeeMachine = context.getBean(CoffeeMachine.class);
        coffeeMachine.makeCoffee("Java");
    }
}
最近下载更多
littlejuck  LV2 2023年6月11日
最近浏览更多
220611325 10月17日
暂无贡献等级
周 敬博  LV2 6月6日
小自立 5月17日
暂无贡献等级
littlejuck  LV2 2023年6月11日
lunkuokuo  LV2 2023年5月8日
13732710091 2023年4月3日
暂无贡献等级
专打不服之徒  LV3 2023年3月22日
阿沅的花与草  LV7 2022年12月9日
200171  LV9 2021年6月26日
syy001005  LV7 2021年6月23日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友