AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
### bean ~~~ public class UserService { private String name; private Integer age; private Date birthday; public void setName(String name) { this.name = name; } public void setAge(Integer age) { this.age = age; } public void setBirthday(Date birthday) { this.birthday = birthday; } public void saveUser(){ System.out.println(name + " --- "+ age + " --- "+ birthday); } } ~~~ ### bean.xml ~~~ <!--配置一个日期对象--> <bean id="now" class="java.util.Date"/> <bean name="userService" class="com.test.service.UserService"> <property name="name" value="test"/> <property name="age" value="11"/> <property name="birthday" ref="now"/> </bean> ~~~ ### test ~~~ public static void main(String[] args) { ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml"); UserService userService = (UserService) ac.getBean("userService"); userService.saveUser(); } ~~~