<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
singleton:此模式會在ApplicationContext建立後建立組態檔中所有的singleton元件,也就是說在「ApplicationContext context = new ClassPathXmlApplicationContext("beans.config.xml");」
這一行時物件該new的都new了,呼叫getBean只是回傳已經new好的Bean物件而已