在Spring中如何配置Bean

答案解析

可以通过 XML 配置 <bean> 标签,或用注解(@Component、@Service 等)结合 @Configuration/@Bean 注解实现 Java 配置。