corda/test/Reflection.java

14 lines
442 B
Java
Raw Normal View History

2007-07-24 01:44:20 +00:00
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");
2007-07-25 00:34:45 +00:00
Class output = Class.forName("java.io.PrintStream");
2007-07-24 01:44:20 +00:00
Method println = output.getDeclaredMethod("println", String.class);
println.invoke(out.get(null), "Hello, World!");
}
}