亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

spring BeanFactory 的getbean 有幾個重載的方法?

spring BeanFactory 的getbean 有幾個重載的方法?

鴻蒙傳說 2018-10-18 06:02:36
spring BeanFactory 的getbean 有幾個重載的方法
查看完整描述

1 回答

?
慕妹3242003

TA貢獻1824條經驗 獲得超6個贊

有四個:(要學會去查看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.

查看完整回答
反對 回復 2018-11-17
  • 莫輕言0521
    莫輕言0521
    4.1版本后新加了一個 5:<T> T getBean(Class<T> requeiredType,Object...args ) throw BeansException;
  • 1 回答
  • 0 關注
  • 1571 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號