mirror of
https://github.com/corda/corda.git
synced 2024-12-29 09:18:58 +00:00
14 lines
442 B
Java
14 lines
442 B
Java
import java.lang.reflect.Method;
|
|
import java.lang.reflect.Field;
|
|
|
|
public class Reflection {
|
|
public static void main(String[] args) throws Exception {
|
|
Class system = Class.forName("java.lang.System");
|
|
Field out = system.getDeclaredField("out");
|
|
Class output = Class.forName("java.io.PrintStream");
|
|
Method println = output.getDeclaredMethod("println", String.class);
|
|
|
|
println.invoke(out.get(null), "Hello, World!");
|
|
}
|
|
}
|