---
title: "Spring 泛型 反射调用方法"
author: "daoshud1"
date: "2013-08-26T14:52:34Z"
tags: []
categories: ["编程语言"]
slug: "spring"
draft: false
lastmod: "2013-08-26T14:52:34Z"
id: 1930999
url: "https://daoshud1.iteye.com/blog/1930999"
---

```java

Object cz=springUtil.getBean(cl);//传入参数Class，返回泛型，这里的声明必须为object，否则会报各种错误
Method method=cz.getClass().getMethod(methodName);
method.invoke(cz);

```