java对方法进行反射
1.获取类的class信息
2.获取method
3.invoke方法执行method
被反射对象
```
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
private String id;
private String username;
private String gongzhong;
private String starttime;
private String score;
private String progress;
}
```
反射方法
```
Class clazz = User.class;
User user = new User();
Method method = clazz.getMethod("setUsername",String.class);
method.invoke(user,"123");
log.info(user.toString());
```