- package com.CricleDependent;
- import org.springframework.context.annotation.AnnotationConfigApplicationContext;
- public class Main {
- public static void main(String[] args) {
- AnnotationConfigApplicationContext an = new AnnotationConfigApplicationContext(Config.class);
- AService aBean = an.getBean(AService.class);
- BService bBean = an.getBean(BService.class);
- aBean.test();
- bBean.test();
- }
- }
|