======== 匿名Bean ======== 在工厂配置文件中,只指定Bean的class,不指定Bean的id。 /src/main/resources/applicationContext.xml: ... ... Spring会自动分配一个默认ID,如cn.tedu.hellospring.Student#0。 如果一个Bean只被使用一次且不被其它Bean引用,则可以不指定id。 例程:HelloSpring