Spring GetType method: get the type of JavaBean

getType(String name)

Example

public static void main(String[] args){
  ApplicationContext context = new ClassPathXmlApplicationContext(
    "appContext.xml");  //加载appContext.xml文件
  Class type = context.getType("time");  //获取指定名称的JavaBean的类型
  System.out.println("名称为time的JavaBean的类型是:"+type.getName());
}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>