spring BeanFactory 的getbean 有幾個(gè)重載的方法
1 回答

慕妹3242003
TA貢獻(xiàn)1824條經(jīng)驗(yàn) 獲得超6個(gè)贊
有四個(gè):(要學(xué)會去查看spring的api)
1: <T> T getBean(Class<T> requiredType)
Return the bean instance that uniquely matches the given object type, if any.
2: Object getBean(String name)
Return an instance, which may be shared or independent, of the specified bean.
3:<T> T getBean(String name, Class<T> requiredType)
Return an instance, which may be shared or independent, of the specified bean.
4: Object getBean(String name, Object... args)
Return an instance, which may be shared or independent, of the specified bean.
- 1 回答
- 0 關(guān)注
- 1584 瀏覽
添加回答
舉報(bào)
0/150
提交
取消