-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.java
More file actions
24 lines (19 loc) · 962 Bytes
/
Copy pathExample.java
File metadata and controls
24 lines (19 loc) · 962 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
package org.example.stis;
import java.io.Serializable;
public class Example {
public static void main(String[] args) {
TypeDescriptor descriptor = TypeDescriptor.describe(Math.class);
System.out.println("Class name: " + descriptor.getClassName());
System.out.println("Modifiers: " + descriptor.getModifiers());
System.out.println("Super class: " + descriptor.getSuperClass());
System.out.println("Interfaces: " + descriptor.getInterfaces());
System.out.println("\nFields:");
for (TypeDescriptor.FieldInfo field : descriptor.getFields()) {
System.out.println(field.getModifiers() + " " + field.getType() + " " + field.getName());
}
System.out.println("\nMethods:");
for (TypeDescriptor.MethodInfo method : descriptor.getMethods()) {
System.out.println(method.getModifiers() + " " + method.getReturnType() + " " + method.getName());
}
}
}