public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("application-context.xml"); SayHello hello = (SayHello) context.getBean("hello"); hello.greet(); for (int i = 0; i < 10; i++) { hello.addUser(); } hello.printUsers(); }