01: import java.lang.reflect.*;
02: import java.io.*;
03: 
04: /**
05:    This program prints "Hello, World" the hard way,
06:    using reflection.
07: */
08: public class HardHello
09: {
10:    public static void main(String[] args)
11:       throws NoSuchMethodException, IllegalAccessException,
12:              InvocationTargetException
13:    {
14:       Method m = PrintStream.class.getDeclaredMethod(
15:             "println", String.class);
16:       m.invoke(System.out, "Hello, World!");
17:    }
18: }
19: