-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.java
More file actions
31 lines (23 loc) · 805 Bytes
/
Copy pathApp.java
File metadata and controls
31 lines (23 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com;
import com.utils.CommonUtils;
import java.util.Date;
/**
* @author ManhKM on 8/1/2022
* @project Java-Reflection
* -----
* Testing Java Reflection để lấy các thông tin của Class
*/
public class App {
public static void main(String[] args) {
try {
Class clazz = Class.forName("com.reflect.Person");
CommonUtils.getFields(clazz);
CommonUtils.getClassInfo(clazz);
CommonUtils.getMethods(clazz);
Object obj = CommonUtils.createObject(clazz, new String[]{"name", "address", "birthday"}, new Object[]{"ManhKM", "Thái Bình", new Date(1996, 4, 30)});
System.out.println("Object Person: " + obj);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}