1public static void main(String[] args) {
2 AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
3
4 ctx.register(AppConfig.class, OtherConfig.class);
5 ctx.register(AdditionalConfig.class);
6 ctx.refresh();
7
8 MyService myService = ctx.getBean(MyService.class);
9 myService.doStuff();
10}