The id attribute is a string that identifies the individual bean definition.
The class attribute defines the type of the bean and uses the fully qualified classname.
id是标识单个Bean定义的字符串,class是定义Bean的类型并使用全限定类名。
下面看我们需要配置的XML:
(对于XML文件的名字无特殊要求,这里我们命名为beans.xml)